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

Sublime​Linter-eslint

by SublimeLinter ST3

This linter plugin for SublimeLinter provides an interface to ESLint

Details

Installs

  • Total 159K
  • Win 50K
  • OS X 82K
  • Linux 27K
Apr 20 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
Windows 1 23 25 29 31 33 22 24 34 36 40 44 37 26 22 32 30 37 25 24 19 18 33 37 29 36 27 16 12 25 26 29 40 26 23 21 27 40 34 30 45 18 13 18 39 27
OS X 2 33 43 66 66 45 28 14 56 51 50 49 43 22 16 49 61 56 58 60 18 14 45 67 44 66 43 20 13 36 44 40 48 57 33 33 51 65 60 41 46 30 22 50 53 47
Linux 1 15 15 22 15 17 11 15 21 22 16 19 23 8 17 23 35 35 20 17 16 15 31 20 23 19 25 8 15 16 24 30 38 38 16 11 27 23 31 22 12 5 15 18 25 27

Readme

Source
raw.​githubusercontent.​com

SublimeLinter-eslint

This linter plugin for SublimeLinter provides an interface to ESLint. It will be used with files that have the “javascript” syntax.

Installation

SublimeLinter 3 must be installed in order to use this plugin.

Please install via Package Control.

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

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

  • Install eslint globally by typing the following in a terminal:

npm install -g eslint
  • Or install eslint locally in your project folder (you must have package.json file there):
npm install eslint

Using eslint with plugins (e.g. vue)

If you're using plugins for eslint so that it can lint files other than .js, you need to tell SublimeLinter it's ok to lint those files too. For this you can change the "selector" setting to include the scope of the other syntax. For vue this would be:

"linters": {
    "eslint": {
        "selector": "text.html.vue, source.js - meta.attribute-with-value"
    }
}

Settings

You can configure eslint options in the way you would from the command line, with .eslintrc files. For more information, see the eslint docs.

FAQ and Troubleshooting

I've got 'SublimeLinter: ERROR: eslint cannot locate 'eslint' in ST console when I try to use locally installed eslint.

You must have package.json file if install eslint locally. Also, restart project or ST itself after to make sure SublimeLinter uses correct eslint instance.

npm init -f
npm install eslint

I've got 'SublimeLinter: eslint ERROR: ESLint couldn't find a configuration file' when I am editing a Javascript file.

If using SublimeLinter 4, the linter is trying to always lint the current view, even if there is no eslint setup for the project or file. You can easily fix this error by creating an empty .eslintrc file in your home directory. This file will be picked up by the linter when there is no locally-defined ESLint configuration.

Use your editor of choice and create this config file, or do this on a terminal:

cd $HOME # or cd %HOMEPATH% on Windows
touch .eslintrc
echo '{ "rules": {} }' > .eslintrc