Alex Fainshtein Alex Fainshtein - 1 month ago 32
TypeScript Question

How to configure IntelliSense for TypeScript in Visual Studio 2015?

I am using Visual Studio Community 2015 with Web Essentials (if this is relevant). IntelliSense works fine when editing files.

But recently it started also generating multiple warnings about style, syntax etc. (This, maybe, happened after I updated VS to version 14.0.25431.01 Update 3; or have I updated Web Essentials too?).

I really like some of these warnings, but they are drowned in the warnings that are of no use for me:

enter image description here

The warnings there have links to the rules, all pointing to Palantir's tslint on Github. However, I cannot find a way to configure this tool (if Visual Studio's IntelliSense indeed uses tslint). I never installed it explicitly, I do not have tslint.json file on my computer.

I know that I can filter in the Warning window to show only a certain keyword. But how can I configure IntelliSense to suppress some rules?

Answer

Found very similar question, Configure tslint with VS 2015 Update 2. It helped to dig around.

Turns out, this tslint is indeed run by VS, this facility is called 'Web Code Analysis'. There is tslint.json file in the Users\ folder, it is accessible via Tools|Web Code Analysis menu. (Actually, this menu shows a few other lint tools too, and I do not know how to tell which of them are run. The referenced question says that you can see it using process monitor; I do not use it.)

You can place another tslint.json file in the project root folder and have project-specific settings. Beware that it should be saved in UTF-8 encoding and not in UTF-8-BOM or ANSI, for example. Also beware that placing // comments there may stop tclint from working.