Disable TSLint in VSCode

2020-05-16 13:32发布

问题:

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.

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?

回答1:

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.



回答2:

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.



回答3:

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

save and restart VSCode