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 147K
  • Win 46K
  • OS X 76K
  • Linux 25K
Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6
Windows 2 31 36 42 46 44 41 19 35 41 43 44 44 47 26 15 31 43 32 47 34 22 38 39 40 58 38 39 29 18 49 59 57 47 59 21 27 53 44 64 47 45 27 29 46 42
OS X 2 33 40 57 49 57 68 36 26 48 76 75 62 73 32 39 54 74 57 74 76 24 36 58 62 71 78 56 39 38 59 82 87 59 79 24 33 70 79 85 69 69 28 23 73 73
Linux 4 18 22 30 19 36 20 20 19 17 33 23 27 35 16 14 23 28 24 20 19 12 13 25 31 25 33 18 8 23 25 23 22 32 28 16 14 27 25 29 23 24 13 17 29 28

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