eslint - Sublime Text 4 - 如何设置 LSP-eslint
问题描述
当使用 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 中的本地开发依赖项下都有 - 听起来我不应该)
解决方案
安装LSP- typescript 就可以了,开箱即用,甚至不需要 lsp-eslint。虚幻。
经过几天的研究,在这里找到了信息(感谢 chrsap!)。
如果您正在运行 ST3,请查看LSP-typescript 的自述文件以获取所需的包。
推荐阅读
- python - 如何获取文本文件的一列
- angular - 错误:Angular JIT 编译失败:'@angular/compiler' 未加载!在使用 AOT 在 Angular 9 中创建动态组件时
- ruby-on-rails - 将文件夹参数添加到 Rails 简单表单上传
- php - 在 php 中显示 youtube 的私人视频
- ubuntu - guile-config 无法运行
- r - 如何在 simmer R 中设置初始队列长度(queue_count)?
- java - 通用记录到 POJO
- keyboard - 将键盘扫描代码解析为实际输入的字符
- mysql - 指定的密钥太长;使用 knex 的最大密钥长度为 767 字节
- c++ - OpenCV:findContours的结果无法填充