ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

ESLint

by polygonplanet ALL Trending

ESLint any JavaScript file in Sublime Text

Details

Installs

  • Total 153K
  • Win 59K
  • Mac 65K
  • Linux 29K
Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5
Windows 1 8 10 2 2 3 5 6 8 4 8 8 2 1 5 3 2 3 2 3 6 5 9 1 8 3 1 6 10 7 7 4 8 3 3 3 6 7 3 2 3 0 5 10 12 8
Mac 1 9 5 8 3 2 1 3 2 5 4 3 0 4 6 6 5 1 2 1 2 3 1 7 2 0 3 1 4 10 2 8 5 1 1 6 6 5 9 4 3 6 6 4 3 3
Linux 1 3 2 0 1 3 0 3 3 2 1 4 3 3 4 3 2 1 0 2 4 2 1 3 9 1 1 4 4 2 3 10 6 5 1 4 3 0 8 3 2 0 6 5 3 3

Readme

Source
raw.​githubusercontent.​com

ESLint for Sublime Text

Lint ECMAScript/JavaScript syntax by ESLint in Sublime Text 2 and 3.

Prerequisites

Installation

Install Node.js and eslint

Before using this plugin, you must ensure that eslint is installed on your system. To install eslint, do the following:

  1. Install Node.js (and npm on Linux).

  2. Install eslint globally by typing the following in a terminal:

npm install -g eslint

Install plugin

Install this plugin by using Sublime Text Package Control.

  1. Open “Command Pallet” Ctrl + Shift + p (Cmd + Shift + p on OSX)
  2. Select “Package Control: Install Package”
  3. Select ESLint

Run ESLint

ESLint an active JavaScript file.

  • Open the context menu (right-click), and Select ESLint,
    Or Open “Command Pallet” and Select ESLint,
    Or keyboard shortcut: Ctrl + Alt + e (Cmd + Option + e on OSX)

  • F4 : Jump to next error row/column

  • Shift + F4 : Jump to previous error row-column

Note: The Ctrl + Alt + e (Cmd + Option + e on OSX) shortcut changes the Build System on the current file to ESLint, then Builds to run ESLint on the file and output any errors for jumping to within the file. You could alternatively set the Build System to Automatic and Ctrl + b (Cmd + b on OSX) or F7, but only on files that end with .js.

Configuring ESLint

ESLint allows you to specify the JavaScript language options you want to support by using .eslintrc file, it will use the first .eslintrc file found traversing from the active file in Sublime Text up to your project's root.

You can configure ESLint options by specify .eslintrc file. For more information, see the ESLint docs.

Settings

Several settings are available to customize the plugin's behavior. Those settings are stored in a configuration file, as JSON.

Go to “Preferences / Package Settings / ESLint / Settings - User” to add your custom settings.

node_path

Default: ""

The directory location of your node executable lives. If this is not specified, then it is expected to be on Sublime's environment path.

node_modules_path

Default: ""

The directory location of global node_modules via npm. If this is not specified, then it is expected to be on system environment variable NODE_PATH.

config_file

Default: ""

This option allows you to specify an additional configuration file for ESLint. If not specified, follows the default config file hierarchy. This option works same as ESLint -c or --config command line option.

For more information, see the ESLint docs.

Example:

{
  "node_path": "/usr/local/bin",
  "node_modules_path": "/usr/local/lib/node_modules",
  "config_file": "/path/to/.eslintrc.js"
}

ESLint on save

Install SublimeOnSaveBuild