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 133K
  • Win 41K
  • OS X 70K
  • Linux 22K
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 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13
Windows 19 38 32 48 59 63 85 49 33 33 79 66 61 87 64 42 25 58 93 63 68 61 23 22 68 60 64 40 72 39 36 59 85 61 55 59 32 38 74 63 73 73 77 28 35 58
OS X 26 43 27 98 106 118 110 90 38 51 104 124 125 133 152 35 44 98 120 111 137 111 22 37 94 112 92 65 86 54 57 112 97 112 103 106 31 32 92 104 90 79 97 46 30 93
Linux 5 18 19 22 40 31 43 39 19 24 26 45 30 42 36 23 13 25 41 31 36 31 25 26 29 38 46 23 29 27 20 32 33 38 33 29 15 19 29 32 28 31 22 10 25 29

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