jods
jods

Reputation: 4591

Configure tslint with VS 2015 Update 2

I can't get tslint to work properly in Visual Studio 2015. I should precise that:

The linter runs: I can see warnings in my error pane and when I right-click a TS file I have a command "Run Web Code Analysis".

Now I want to configure the rules by adding a tslint.json file in my project (I tried various places). As soon as I add one -- even a copy of the default one from my user profile -- I do get no warning at all.

Using process monitor I can confirm that the linter runs in both cases and that it reads tslint.json from the correct place (my project or my user profile). But even if the file is exactly the same, when it runs from my project there is no result in VS??

Upvotes: 2

Views: 858

Answers (1)

Wanton
Wanton

Reputation: 840

I had this exact problem. Took hours to find this but you can make tslint.json work in project root if you change line endings from UNIX to Windows/Dos (from \n to \r\n).

Update: First I thought it was line endings that was causing this problem. But it's actually tslint.json files encoding. If encoding is shown as UTF-8-BOM in Notepad++ the file refuses to work. If you change tile encoding to UTF-8 it starts to work.

Upvotes: 1

Related Questions