Disable TSLint in VSCode

2020-05-16 13:21发布

So this feels like this should be such an easy task but it's starting to drive me insane. I can't seem to turn off TSLint or TS or whatever it is that gives me these errors. I just want the ESLint with my own configured rules, nothing else.

I only want the ESLint error

Is it built in TS? I have disabled TSLint extension (even uninstalled it). I have set the following rules:

"typescript.format.enable": false,
"typescript.validate.enable": false,

Still gives me error. How do I turn this off?

3条回答
干净又极端
2楼-- · 2020-05-16 13:50

Ctrl-Shift-P (Command Palette) "Preferences: Open Workspace Settings" add "tslint.enable":false

save and restart VSCode

查看更多
霸刀☆藐视天下
3楼-- · 2020-05-16 14:05

It seems that the error is coming from the TypeScript extension, which is also handling the JavaScript IntelliSense. Due to some UX ignorance, VSCode prefixes the error with [ts] instead of [js].

To disable these validations, set

"javascript.validate.enable": false

See this issue for more details.

查看更多
一纸荒年 Trace。
4楼-- · 2020-05-16 14:13

I've been hunting around for this answer for the better part of a month now. I found a solution that works in VS Code that isn't a wholesale disabling of all validation for javascript and also did not require that I add files/declarations to a repository that is not mine.

Add this line to your user settings:

"javascript.suggestionActions.enabled": false

Unlike "javascript.validate.enable": false (which you should not use), the above setting will remove those annoying [ts] Could not find a declaration file for module errors for untyped module imports in javascript files and it will still play nice with linters and give you appropriate and relevant errors.

查看更多
登录 后发表回答