eslint-config-lob
v6.0.0
Published
Shareable ESLint config for Lob repositories
Downloads
12,267
Maintainers
Readme
eslint-config-lob
Shareable ESLint configuration for Lob repositories
Usage
- Install
eslint
and this module:
npm i eslint eslint-config-lob --save-dev
- Create an
.eslintrc
file in the root of your project with the following object:
{
extends: "eslint-config-lob"
}
This will use the rules in eslint-config-lob's index.js
. You can access rules in files other than eslint-config-lob's index.js
via:
{
extends: "eslint-config-lob/migrations"
}
- Use an
.eslintignore
file to specify files or directories that the linter should ignore. By default, eslint ignores thenode_modules
directory. - Modify or create the npm
lint
script in the package.json to:
{
"scripts": {
"lint": "eslint ."
}
}
This will lint every .js
file in your project.
- Clean up any old lint or style tasks and config from your project.
- Don't forget to shrinkwrap before you commit your changes.
Contributing
Modifying or adding rules.
- To add to the main rules, modify the
index.js
file. - To use most of the main rules but override some of them, create a new file in the root of this module, extend from
index.js
and add your overrides. Seemigrations.js
for an example. If you're creating a file like this, its rules should be reusable and not a one-off. For example, you could create a file for angular rules. To make a one-off change, do so in your project's.eslintrc
.