We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7bac3e commit f6797e1Copy full SHA for f6797e1
assets/vscode-eslint-error.png
-47.2 KB
engineering/lint.md
@@ -191,24 +191,7 @@ type Foo = {};
191
192
要在 VSCode 中集成 ESLint 检查,我们需要先安装 ESLint 插件,点击「扩展」按钮,搜索 ESLint,然后安装即可。
193
194
-VSCode 中的 ESLint 插件默认是不会检查 `.ts` 后缀的,需要在「文件 => 首选项 => 设置 => 工作区」中(也可以在项目根目录下创建一个配置文件 `.vscode/settings.json`),添加以下配置:
195
-
196
-```json
197
-{
198
- "eslint.validate": [
199
- "javascript",
200
- "javascriptreact",
201
- "typescript"
202
- ],
203
- "typescript.tsdk": "node_modules/typescript/lib"
204
-}
205
-```
206
207
-这时再打开一个 `.ts` 文件,将鼠标移到红色提示处,即可看到这样的报错信息了:
208
209
-
210
211
-我们还可以开启保存时自动修复的功能,通过配置:
+通过配置 VSCode,可以开启保存时自动修复的功能:
212
213
```json
214
{
0 commit comments