ESLint configuration
Installation
npm i -sD eslint eslint-config-eb1
Usage
Create a .eslintrc.js
file in your project root.
Import the base configuration:
module.exports = {
extends: ['eslint-config-eb1'],
rules: {
}
}
Add lint script to package.json
:
{
"scripts": {
"lint": "eslint src"
}
}
Lint your source with npm run lint
and automatically fix issues with npm run lint -- --fix
VS Code integration
ESLint VS Code extension can help teams using VS Code by highlighting issues in the editor and autofixing on save (add "eslint.autoFixOnSave": true
to your VS Code settings). You can also suggest installing the extension to anyone checking out the repository. Just create the following file: .vscode/extensions.json
:
{
"recommendations": [
"dbaeumer.vscode-eslint"
]
}