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 151K
  • Win 47K
  • OS X 78K
  • Linux 26K
Dec 14 Dec 13 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
Windows 35 36 41 42 45 19 32 57 55 42 27 46 26 19 46 34 145 46 45 34 22 33 39 45 43 41 18 24 39 48 60 44 24 22 26 33 39 43 35 47 24 24 34 40 36 39
OS X 42 57 57 47 63 27 30 63 66 60 66 43 34 27 69 74 55 72 47 36 28 35 42 58 56 71 31 25 66 80 76 62 105 26 24 48 84 81 62 58 29 32 47 65 69 51
Linux 22 18 21 25 30 15 11 21 14 22 29 20 12 18 24 36 27 22 27 17 16 19 22 24 19 16 14 7 21 24 29 25 27 9 9 15 29 33 32 13 11 18 18 24 19 33

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