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

ESLint

by polygonplanet ST2/ST3

ESLint any JavaScript file in Sublime Text

Details

Installs

  • Total 58K
  • Win 20K
  • OS X 29K
  • Linux 9K
Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28
Windows 31 54 28 29 57 53 51 59 45 23 34 49 57 47 52 51 22 24 40 53 50 48 61 33 34 60 64 46 83 59 42 33 50 54 49 58 66 35 25 44 58 63 54 58 24 33
OS X 25 68 23 24 76 74 75 79 64 18 35 61 66 94 68 61 23 31 47 54 70 80 75 29 31 46 81 70 66 80 42 30 82 87 84 70 66 37 39 76 81 88 75 80 31 32
Linux 12 27 9 13 17 34 24 26 28 16 6 18 28 12 26 22 13 16 22 29 21 14 24 20 16 32 26 24 20 16 11 21 26 24 27 36 22 17 11 20 26 28 32 30 11 16

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