4

When using Sublime text 3 I had SublimeLinter with SublimeLinter-eslint packages, along with eslint & babel-eslint global node modules for JS & JSX syntax.

With the switch to Sublime 4 I decided to give LSP a try. I Installed it, also LSP-css (which ran fine out of the box) & LSP-eslint, which couldn't get to work.

If I check Sublime's status bar I see the language server apparently running (?) enter image description here

This is within a project with it's own eslintrc.js config file, which works out of the box in VScode. Part of it below:

const RulesAirBnb = require("eslint-config-airbnb-base/rules/best-practices");
const RulesCRA = require("eslint-config-react-app");

module.exports = {
    root: true,

    parser: "babel-eslint",
    parserOptions: {
        ecmaVersion: 2018,
        sourceType: "module",
        ecmaFeatures: {
            jsx: true,
            generators: true,
        },
    },

    extends: [
        "airbnb", // Baseguide is AirBnB"s
        "prettier",
        "prettier/react",
    ],

Checked the following SO question but no luck.

  • How to make it work?
  • Do I still need global node modules of eslint & babel-eslint? (considering I have both locally under dev dependencies in the package.json of the project - sounds to me I shouldn't)
Syden
  • 8,425
  • 5
  • 26
  • 45
  • If it's shown in the status bar, then it is running. Did you try configuring it following the [directions in the README](https://github.com/sublimelsp/LSP-eslint#readme)? – MattDMo Jul 18 '21 at 15:33
  • Thanks for the reply Matt, long live dads! I actually went through it (readme) and from what I gathered it should be working out of the box upon installation as lsp-css did (?). Also, I wonder the same, seems like it's running fine in status bar, but if I make some mistakes on the JSX file nothing shows up, whether SublimeLinter would highlight them. I spent a few hours researching the web but unfortunately there is not much info about lsp-eslint or even a setup walkthrough within Sublime. – Syden Jul 18 '21 at 23:18

1 Answers1

6

Installing LSP-typescript did the trick, works out of the box, lsp-eslint not even needed. Unreal.

Found the info here after days of research (thanks chrsap!).

If you are running ST3, check LSP-typescript's readme for needed packages.

Syden
  • 8,425
  • 5
  • 26
  • 45