Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Visual Studio from trying to parse typescript

Working on a project using Visual Studio as my IDE. It has an API component written in C#, and a webserver component that uses TypeScript.

I am using webpack to deal with the typescript compilation and would like to remove the Visual Studio build step from the typescript files.

Normally I wouldn't care if it was building them, but I am using Typescript > 1.8.4 which has language features that Visual Studio cannot understand which is making Visual Studio throw errors and prevent compilation. I found a workaround for this in this github issue thread but I have other developers cross team who are working on this and trying to coordinate a hack to make code among them will not work.

I have also tried removing the typescript imports line from the .csproj file, but whenever I add a new ts file, it adds the line back in.

Is there a way to completely shut down the typescript compilation/parsing step in Visual Studio and prevent it from coming back?

This in in VS 2015.

like image 802
tt9 Avatar asked Jul 26 '16 15:07

tt9


People also ask

How do I disable TypeScript compilation in Visual Studio?

Currently, there are a few ways to "disable TypeScript" in VS. You could go to Tools > Options > Text Editor > JavaScript/TypeScript > Project and uncheck the Project Analysis options.

How to disable TypeScript in Visual Studio code?

enable": false //... } in our settings. json file to disable TypeScript and JavaScript warnings by setting typescript. validate.

How do I disable TypeScript?

To disable a TypeScript rule for a specific line, we can use the @ts-ignore comment. to add the // @ts-ignore: Unreachable code error comment so that the TypeScript compiler ignores the unreachable code error in the line after the comment.


1 Answers

You can disable typescript compilation by editing the .csproj file to contain the following:

<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> 

That should disable all typescript compilation within VS 2015.

like image 159
Sam Storie Avatar answered Oct 01 '22 20:10

Sam Storie