Step 1 : Install ESLint globally using NPM
npm install -g eslint
Step 2 : Install Package Control in Sublime Text 3
For installing the Package Control in Sublime Text 3 we have to copy the code from PackageControl.IO and run it in the console of Sublime Text.
The console can be accessed via the shortcut ctrl + ` or the View > Show Console menu.
Now you have to copy the code to the console and hit enter, which will install the package control.
Step 3 : Next step is to install a config using NPM
Next we have to install a configuration of eslint using the command npm install --save-dev eslint-config-rallycoding.
Step 4 : Extending the Configuration
Now we have to create a .eslintrc file inside our project and tell ESLint to make use of the configuration as shown below :
"extends" : "rallycoding"
Step 5 : Adding Linter and ESLint to Sublime Text
Next we have to add a linter and eslint to sublime text using Package Control. At first we will open up the Command Pallet using the shortcut Ctrl + Shift + P and then search for Install Package. It will load up the Installation window where we have a list of packages available to be installed. Then we will install SublimeLinter (a Linter) and SublimeLinter-contrib-eslint (ESLint).
After going through all the steps close the Sublime Text and open it again. You can see that if I do not give a semi colon it will throw an error to me as shown below :
Please Like and Share the CodingDefined Blog, if you find it interesting and helpful.