当使用 Sublime text 3 时,我有SublimeLinter和SublimeLinter-eslint包,以及用于 JS 和 JSX 语法的eslint和babel-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",
],
检查了以下SO 问题,但没有运气。
- 如何让它发挥作用?
- 我还需要eslint和babel-eslint的全局节点模块吗?(考虑到我在项目的 package.json 中的本地开发依赖项下都有 - 听起来我不应该)