A CLI wrapping a simple eslint config based on eslint-config-airbnb-base.
The rules/options that differ from airbnb's base:
- JSON plugin to lint syntax errors.
- import/extensions are set to never include
.js
and.mjs
, but always require other extensions. - import/no-nodejs-modules Disallow Node.js built-in modules.
Add the package as a dev dependency:
npm i -D https://github.com/cbodin/quicklint-eslint.git#v1.0.0
The default behavior is to lint all the .mjs
, .js
and .json
files in the src/
folder.
If any other folders should be used, the search paths can be specified with the --paths
argument.
To include both the default src/
folder and a server/
folder, both paths will need to be supplied:
quicklint-eslint --paths src/,server/
Run npx quicklint-eslint -h
for a list of all options.
A common scenario is to include a test script in your package.json
file:
{
"scripts": {
"test": "quicklint-eslint"
}
}
If some configuration options need to be changed, a .eslintrc.*
file can be created in the root of the project.
The options set in this file will take precedence over the default supplied config.
Read more at the eslint documentation.