@wellmade/lint-staged-config
v0.1.3
Published
Wellmade's shared lint-staged config — wires up the @wellmade/{eslint,prettier,stylelint}-config trio for pre-commit.
Downloads
341
Maintainers
Readme
@wellmade/lint-staged-config
The pre-commit pipeline that ties @wellmade/eslint-config,
@wellmade/prettier-config, and @wellmade/stylelint-config together.
One install, one line of config.
Install
npm install --save-dev husky lint-staged \
@wellmade/eslint-config @wellmade/prettier-config @wellmade/stylelint-config \
@wellmade/lint-staged-config
npx husky init
echo "npx lint-staged" > .husky/pre-commit
chmod +x .husky/pre-commitPoint lint-staged at this config — either in package.json:
{
"lint-staged": "@wellmade/lint-staged-config"
}…or in lint-staged.config.js:
export { default } from '@wellmade/lint-staged-config';What runs
| Files matched | Commands (in order) |
| --------------------------------------------------- | --------------------------------- |
| *.{js,mjs,cjs,jsx,ts,mts,cts,tsx} | eslint --fix, prettier --write |
| *.css | stylelint --fix, prettier --write |
| *.{md,mdx,json,jsonc,yml,yaml,html,svg} | prettier --write |
ESLint and Stylelint run before Prettier so they can rewrite imports or property order; Prettier then normalizes whitespace.
Overriding
// lint-staged.config.js
import base from '@wellmade/lint-staged-config';
export default {
...base,
// Add project-specific tasks here.
'*.proto': ['buf format --write'],
};