Installation Back
According to official documents of ESLint, it can be installed through two ways: globally and locally.
So when should we install it globally or locally? It depends on the case whether you want it to be part of all projects or a single project.
If you want it to be installed in a single project, it's recommended to install locally:
npm install eslint --save-devThen set up a configuration file:
./node_modules/.bin/eslint --initThen check the report of a JavaScript file with running:
./node_modules/.bin/eslint file.jsIf you want to use ESLint in any project you have, you can just install it globally:
npm install -g eslintThen set up a configuration for a project:
eslint --initThen also check the report in the same way:
eslint file.js