Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I suppress spurious Typescript compilation errors in VS2017?

We have a .Net project with some embedded resources that are xml files with a custom filename extension.

For some reason, on my computer, Visual Studio has suddenly (for the last few days) decided to treat these as TypeScript files and is producing tens of thousands of compile errors on each build.

enter image description here

The errors don't stop the build, but they do slow it down and make it hard to work out what the real errors are when I have them.

So far I've tried adding

<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>

to my csproj files, and I've looked at the "Compile on Save" setting for Javascript and it is not enabled. Neither of these fixes seem to work.

We don't have any TypeScript in our project at all.

I'm running Visual Studio 2017 15.5.7

Nobody else in my team is reporting this issue.

like image 261
dylanT Avatar asked Sep 17 '25 11:09

dylanT


1 Answers

I was able to get rid of the TS errors hence the build failures with below settings in VS 2019

Tools > Options > Text Editor > JavaScript/TypeScript > Code Validation > JavaScript Errors > Set the values under JavaScript Errors to False.

enter image description here

like image 69
Nalin Avatar answered Sep 20 '25 05:09

Nalin