ESLint
ESLint any JavaScript file in Sublime Text
Details
Installs
- Total 149K
- Win 57K
- Mac 64K
- Linux 28K
Jun 6 | Jun 5 | Jun 4 | Jun 3 | Jun 2 | Jun 1 | May 31 | May 30 | May 29 | May 28 | May 27 | May 26 | May 25 | May 24 | May 23 | May 22 | May 21 | May 20 | May 19 | May 18 | May 17 | May 16 | May 15 | May 14 | May 13 | May 12 | May 11 | May 10 | May 9 | May 8 | May 7 | May 6 | May 5 | May 4 | May 3 | May 2 | May 1 | Apr 30 | Apr 29 | Apr 28 | Apr 27 | Apr 26 | Apr 25 | Apr 24 | Apr 23 | Apr 22 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 2 | 7 | 3 | 5 | 10 | 5 | 8 | 8 | 8 | 3 | 7 | 4 | 6 | 6 | 4 | 10 | 3 | 7 | 4 | 9 | 7 | 8 | 8 | 4 | 4 | 11 | 9 | 8 | 6 | 10 | 3 | 4 | 8 | 8 | 9 | 5 | 5 | 6 | 7 | 7 | 9 | 11 | 9 | 9 | 3 | 6 |
Mac | 3 | 6 | 2 | 4 | 3 | 8 | 2 | 13 | 0 | 1 | 6 | 8 | 7 | 4 | 9 | 6 | 1 | 5 | 3 | 5 | 3 | 7 | 6 | 0 | 4 | 2 | 9 | 6 | 6 | 7 | 2 | 5 | 7 | 11 | 4 | 7 | 2 | 1 | 6 | 9 | 3 | 7 | 10 | 4 | 1 | 3 |
Linux | 1 | 4 | 2 | 2 | 3 | 1 | 2 | 7 | 6 | 1 | 3 | 2 | 3 | 2 | 6 | 4 | 3 | 3 | 3 | 4 | 4 | 6 | 1 | 3 | 1 | 1 | 4 | 3 | 6 | 1 | 4 | 5 | 3 | 5 | 7 | 2 | 6 | 2 | 2 | 3 | 5 | 2 | 2 | 4 | 2 | 4 |
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:
npm install -g eslint
Install plugin
Install this plugin by using Sublime Text Package Control.
- Open “Command Pallet” Ctrl + Shift + p (Cmd + Shift + p on OSX)
- Select “Package Control: Install Package”
- 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