Web Development

How to use Eslint in Sublime

  1. Install nodejs and npm in system.
  2. Install eslint using command
    sudo npm install -g eslint
  3. Create package.json file using command
    npm init

    Fill anything you want

  4. Create config file for eslint using
    eslint --init

    Answer the questions that it will ask

  5. 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.
  6. That’s all

Now to format using eslint Right click and Select Eslint Formatter > Format this file.

Leave a Reply

Your email address will not be published. Required fields are marked *