Skip to content

sublimelsp/LSP-eslint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a232920 · Dec 26, 2023

History

69 Commits
Dec 26, 2023
Jun 22, 2020
Jun 22, 2020
Dec 26, 2023
Sep 10, 2019
Jun 22, 2020
Sep 10, 2019
May 10, 2020
Mar 22, 2023
May 10, 2020
Nov 2, 2021
Jun 22, 2020
Mar 18, 2020
Jun 22, 2020
Dec 26, 2023
Dec 9, 2022
Nov 1, 2023
Feb 5, 2023

Repository files navigation

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