Andy's ESLint configuration
This is a strict and very opinionated ESLint preset for my various JavaScript projects.
Usage
npm i -E -D @andybarron/eslint-config
- Add
@andybarron/eslint-config
to theextends
section of your ESLint configuration file.
Examples
.eslintrc.json
)
JSON config file (e.g. {
"extends": "@andybarron/eslint-config"
}
.eslintrc.yaml
)
YAML config file (e.g. NOTE: The quotes are required due to the @
sign at the beginning of the
scoped package name.
extends: '@andybarron/eslint-config'
Development scripts
-
npm run generate
- Generate an empty list of all non-deprecated ESLint rules. This overwrites the filelib/rules.js
, so be careful! -
npm test
- Ensure that all ESLint rules exist in the preset and that all rules in the preset are valid and not deprecated. -
npm run lint
- Run this linter preset on its own source code (i.e. thelib
andscripts
directories). So meta! -
npm run format
- Same aslint
, but attempt to fix lint errors as well.