Sublime Text 4 - 如何设置 LSP-eslint

Syd*_*den 4 eslint eslint-config-airbnb language-server-protocol eslintrc sublimetext4

当使用 Sublime text 3 时,我有SublimeLinterSublimeLinter-eslint包,以及用于 JS 和 JSX 语法的eslintbabel-eslint全局节点模块。

切换到 Sublime 4 后,我决定尝试一下LSP。我安装了它,还安装了LSP-css(开箱即用)和LSP-eslint,但无法工作。

如果我检查 Sublime 的状态栏,我会看到语言服务器显然正在运行(?) 在此输入图像描述

这是在一个具有自己的eslintrc.js配置文件的项目中,该文件在 VScode 中开箱即用。部分内容如下:

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",
    ],
Run Code Online (Sandbox Code Playgroud)
  • 如何让它发挥作用?
  • 我还需要eslintbabel-eslint的全局节点模块吗?(考虑到我在项目的 package.json 中本地都有开发依赖项 - 听起来我不应该)

检查了以下SO问题但没有运气。

Syd*_*den 7

安装LSP-typescript就成功了,开箱即用,甚至不需要 lsp-eslint。虚幻。

经过几天的研究后在这里找到了信息(感谢 chrsap!)。

如果您正在运行 ST3,请检查LSP-typescript 的自述文件以获取所需的包。