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-dev
Then set up a configuration file:
If you want to use ESLint in any project you have, you can just install it globally:
npm install -g eslint
Then set up a configuration for a project:
Then also check the report in the same way: