@will-stone/eslint-config
v12.0.1
Published
Will Stone's ESLint config
Downloads
329
Readme
@will-stone/eslint-config
My personal ESLint config.
Usage
Install
npm i -D eslint @will-stone/eslint-config
Create config file
// eslint.config.js
import config from '@will-stone/eslint-config'
export default config()
Add script for package.json
For example:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
VS Code support (auto fix)
Install VS Code ESLint extension.
Add the following settings to your .vscode/settings.json
:
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
}
Lint Staged
If you would like to apply lint and auto-fix before every commit, you can add
the following to your package.json
:
{
"scripts": {
"prepare": "husky install"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": ["eslint --fix"]
}
}
and then
npm i -D husky lint-staged
npx husky install
npx husky add .husky/pre-commit "npx --no lint-staged"
Credits
Inspired by the excellent Flat eslint-config by Anthony Fu.