Steps to use Esline in Sublime code editor.
- Install nodejs and npm in system.
- Install eslint using command
sudo npm install -g eslint
- Create package.json file using command
npm init
Fill anything you want
- Create config file for eslint using
eslint --init
Answer the questions that it will ask
- Open sublime and install package
Eslint Formattor
. GotoPreferences > Package Settings > ESLintFormatter > Settings - User
.
Set proper path ofeslint_path
. You can get the path usingwhereis eslint
. Now setconfig_path
as/home/username/.eslintrc.js
. Change username. - That's all
Now to format using eslint Right click and Select Eslint Formatter > Format this file.
Published in: Web Development