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

LSP-eslint

by sublimelsp ST3 Trending

ESLint support for Sublime LSP plugin

Labels linting

Details

  • 1.6.4
    0.1.0
    0.0.6
  • github.​com
  • github.​com
  • 3 months ago
  • 1 hour ago
  • 3 years ago

Installs

  • Total 6K
  • Win 1K
  • Mac 3K
  • Linux 2K
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 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4
Windows 0 7 4 3 3 5 4 5 3 0 3 3 0 1 2 1 2 10 4 5 1 0 8 2 3 6 4 4 1 1 0 2 4 2 5 1 3 1 1 2 1 2 3 3 0 1
Mac 1 3 4 3 4 4 8 8 8 2 3 7 4 10 4 3 5 2 5 2 4 4 6 3 4 3 4 6 4 4 4 3 9 8 5 5 4 4 3 4 12 6 6 5 2 0
Linux 0 3 3 1 1 3 3 3 5 0 0 4 3 2 2 5 2 3 4 1 6 1 2 1 3 5 3 2 3 3 1 4 3 5 1 2 2 1 0 6 1 4 2 5 3 6

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"
        }
      }
    }
  }
}