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.
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.
enable": false //... } in our settings. json file to disable TypeScript and JavaScript warnings by setting typescript. validate.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With