npm install -g eslint
or with plugins
npm install --save-dev eslint babel-eslint eslint-config-airbnb eslint-config-babel eslint-config-prettier eslint-plugin-import
run:
npm install eslint --save-dev
eslint --init
eslint .
eslint --fix
Install:
npm i pre-commit --save-dev
scripts": {
"lint": "eslint src",
"lint:fix": "eslint --fix"
},
- Install vscode eslint plugin
- Create a file called extensions.json in a directory named
.vscode
in the root of the project, with the following content:
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"dzannotti.vscode-babel-coloring"
]
}
Install npm i prettier --save-dev
from NPM Prettier
Install the latest ESLint
npm install eslint -g
Install eslint-config-airbnb-base
npm install eslint-config-airbnb-base -g
Install eslint-plugin-import
npm install eslint-plugin-import -g
Restart VSCode (very important). Try again, maybe the problem is gone.
Source: Coldfusion Coldfusion Translated