How to add ESLint in the project?
First you have to add the node module in the project. For adding node module you have to check this link to create node module.
After installing the node module in the project we need to install the eslint in it.
For that run below command
npm install --save-dev eslint
This will install the eslint package in the node module.
Now to check the eslint package is present or not use the below command:
The eslint command operates through the .bin folder which is created. To check the .bin folder for eslint use:
ls -la node_modules/.bin
Now if you test the ESLint in the code by using the below code.
It will provide error to add the configuration file.
To set the configuration file you have to add the code.
Then it will ask bunch of question for configuration.
Once you will add the question the configuration file will be added and the ESLint is ready to use.
To use you can use the command:
Till now I have research this much about ESLint.
Reference site from where I learn the ESLint: