@maxencebonamy/eslint-plugin
v1.0.1
Published
ESLint plugin for JS, TS, JSX and TSX.
Downloads
186
Readme
ESLint is a static code linter for JavaScript, which means it analyzes your JavaScript code for errors, style problems and coding convention violations. This is my ESLint plugin, which can be used to lint your JavaScript code with my coding style. Is can be used for not only JavaScript but also TypeScript, React, etc.
Install the config:
[!NOTE] Prerequisites:
- [x] NodeJS must be installed on your computer. If not, click here.
- Install the dependency:
npm install -D eslint @maxencebonamy/eslint-plugin
- Paste the following code into the
.eslintrc.json
file:
{
"extends": [
"plugin:@maxencebonamy/base",
"plugin:@maxencebonamy/typescript",
"plugin:@maxencebonamy/react",
],
}
- Add the scripts for linting into the
package.json
file by pasting the following code:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
Enable auto fix with VS Code:
Install ESLint extension.
Paste the folling code into the
.vscode/settings.json
file:
{
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}