Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable TSLint in VSCode

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?

like image 952
Clanket Avatar asked Jun 12 '18 18:06

Clanket


People also ask

How do I stop Tslint in VS Code?

Open settings. json and add this to the bottom: "typescript. validate. enable": false.

How do I disable Tslint?

In addition to global configuration, you may also enable/disable linting for a subset of lint rules within a file with the following comment rule flags: /* tslint:disable */ - Disable all rules for the rest of the file. /* tslint:enable */ - Enable all rules for the rest of the file.

How do I disable TypeScript errors in VS Code?

In the Extensions tab on the left (Ctrl+Shift+X), search for @builtin + JavaScript / TypeScript . Then click the little gear icon next to an Extension and click Disable .

How do I enable Tslint in VS Code?

In your VS Code user or workspace settings, set "typescript. tsserver. log": "terse" . Open a TS file that you believe should have TSLint enabled.


2 Answers

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.

like image 184
user3151902 Avatar answered Sep 23 '22 01:09

user3151902


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.

like image 35
Bita Djaghouri Avatar answered Sep 26 '22 01:09

Bita Djaghouri