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

LSP-eslint

by sublimelsp ST3

ESLint support for Sublime LSP plugin

Labels linting

Details

  • 1.8.0
    0.1.0
    0.0.6
  • github.​com
  • github.​com
  • 5 days ago
  • 55 minutes ago
  • 4 years ago

Installs

  • Total 9K
  • Win 2K
  • Mac 4K
  • Linux 3K
Apr 24 Apr 23 Apr 22 Apr 21 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
Windows 0 3 3 3 7 5 2 7 2 3 0 4 5 8 2 2 5 3 1 3 2 3 9 8 0 1 3 4 1 7 1 1 1 2 3 1 1 3 2 0 2 2 3 1 3 1
Mac 2 7 2 4 4 10 5 4 3 5 2 6 2 1 4 3 4 3 2 4 5 2 4 3 2 2 6 2 3 3 0 2 3 7 3 4 2 4 0 2 7 2 9 4 2 1
Linux 4 3 3 3 2 1 3 4 3 6 5 2 2 6 5 3 6 3 3 3 4 4 1 0 0 2 2 2 3 8 4 6 0 5 4 5 5 5 2 3 2 2 3 5 4 2

Readme

Source
raw.​githubusercontent.​com

LSP-eslint

Eslint support for Sublime's LSP plugin provided through vscode-eslint.

Installation

  • Install LSP and LSP-eslint from Package Control.
  • Restart Sublime.

The server requires the Node runtime to be at version 14 or later.

Configuration

Open configuration file using command palette with Preferences: LSP-eslint Settings command or opening it from the Sublime menu.

Configuration file contains multiple configuration keys:

languages

Defines on which types of files the ESLint server will run.

settings

ESLint configuration options. Refer to the comments for documentation and install LSP-json to automatically validate settings.

FAQ

Q: How to enable linting of Typescript code?

A: Make sure that eslint configuration in your project has typescript-eslint plugin configured. See https://github.com/typescript-eslint/typescript-eslint for more information.

Q: How to enable eslint to fix all issues automatically on saving the file?

A: Open Preferences: LSP Settings from the command palette and add or modify the following setting:

"lsp_code_actions_on_save": {
  "source.fixAll.eslint": true,
},

Q: How to use this in a Yarn 2 project?

A: Install ESLint in the project, run yarn dlx @yarnpkg/pnpify --sdk base (docs) and set settings.nodePath to .yarn/sdks either in LSP-eslint's settings or, if you have other non-Yarn-2 projects, in your .sublime-project:

{
  "settings": {
    "LSP": {
      "LSP-eslint": {
        "settings": {
          "nodePath": ".yarn/sdks"
        }
      }
    }
  }
}