eslint-plugin-pixellot
Plugin used by Pixellot company
Installation
Install @pixellot/eslint-plugin
:
npm install @pixellot/eslint-plugin --save-dev
NOTE: You'll need npm 7 and above to install this plugin.
Usage (one time per repo)
- Install the plugin as explained above
- Add
@pixellot
to the plugins section of your.eslintrc
configuration file, then choose the configuration you wish (e.g:cloudInfra
):
{
"plugins": [
"@pixellot"
],
"extends": ["plugin:@pixellot/cloudInfra"]
}
- Add
.eslintignore
file to indicate ESLint to skip these files/folders (add others, if needed):
node_modules
coverage
- Add the eslint to the
.dockerignore
.eslintrc.js
.eslintignore
- Add the following to the
scripts
property in thepackage.json
file:
"lint": "eslint .",
"lint:fix": "eslint . --fix"
NOTE: You can now run
npm run lint
andnpm run lint:fix
to run the linter on all files / fix them accordingly.
- Add the lint validation to the CI. You can use the
npm run lint
mentioned above.
Configurations
cloudInfra
Used by the cloud infra team.
Based on airbnb-base
, eslint:recommended
and jest
, and some rule tweaks
VSCode Integration
To use eslint with the VSCode IDE:
- Install the ESLint VSCode extension
- In VSCode menu choose:
File->Preferences->Settings
-
Add the following to the
User
settings and save:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.format.enable": true,
"editor.formatOnSave": true,
"editor.formatOnType": true
NOTE: Use: VSCode >= 1.63.2, ESLint Extension >= 2.2.2