Eslint Tutorial
The purpose of Eslint is to detect javascript errors through the command line command.
Pre-condition : Ubuntu user, nodejs and npm installed, an javascript file to test
Check your node and npm installed or not by command : node -v and npm -v
It should show up the version of each respectively.
Install eslint through npm by : npm install -g eslint
Set up a config file using the command : eslint --init You should answer your preference style, not use a standard.
After that, you can run Eslint on any Javascript file ( open terminal in the same folder as your js file) hit command eslint name-of-your-jsfile
If you want to configure the rules of eslint then locate your .eslintrc file in your directory ( should be given after you run eslint --init
Pre-condition : Ubuntu user, nodejs and npm installed, an javascript file to test
Check your node and npm installed or not by command : node -v and npm -v
It should show up the version of each respectively.
Install eslint through npm by : npm install -g eslint
Set up a config file using the command : eslint --init You should answer your preference style, not use a standard.
After that, you can run Eslint on any Javascript file ( open terminal in the same folder as your js file) hit command eslint name-of-your-jsfile
If you want to configure the rules of eslint then locate your .eslintrc file in your directory ( should be given after you run eslint --init
0 Comments:
Post a Comment