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.2
    0.1.0
    0.0.6
  • github.​com
  • github.​com
  • 1 year ago
  • 28 minutes ago
  • 3 years ago

Installs

  • Total 5K
  • Win 1K
  • Mac 2K
  • Linux 1K
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 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18
Windows 3 7 2 4 2 1 2 0 2 3 2 7 3 3 1 3 5 1 2 2 4 1 2 4 1 1 2 2 0 1 1 2 3 2 1 6 1 5 1 1 4 3 3 5 5 3
Mac 4 4 6 3 3 3 4 3 6 8 3 6 2 1 3 5 5 3 10 0 2 8 8 4 4 3 6 1 2 4 7 4 3 1 4 4 8 7 2 1 5 2 4 2 8 2
Linux 2 7 3 6 3 2 2 1 2 4 5 4 3 2 3 12 2 5 4 3 2 1 2 4 4 4 2 0 0 3 1 2 0 5 3 4 3 1 1 6 1 1 3 1 3 4

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