How to use Eslint in Sublime


Steps to use Esline in Sublime code editor.

  1. Install nodejs and npm in system.
  2. Install eslint using command
sudo npm install -g eslint
  1. 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. Goto Preferences > Package Settings > ESLintFormatter > Settings - User.
    Set proper path of eslint_path. You can get the path using whereis eslint. Now set config_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
Originally Published On : May 20, 2016