Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop visual studio from trying to "Add support for typescript" on each file adding

I have a solution with multiple web projects. And there is common tsconfig which is used to build all typescript in solution. Build is called via webpack, so I don't want any typescript support from visual studio. More precisely, I want some support — in navigating and refactoring, but I don't want VS to build this code.

So I removed all references to typescript targets from csproj and everything works fine. But any time I add a new typescript file, VS gladly says

Your project has been configured to support TypeScript

and returns all typescript targets back to csproj.

Can I prevent VS from doing it? Of course I can live with it, but removing garbage from csproj after each adding seems uncomfortable.

UPD: found post on uservoice of VS https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/13420095-ask-to-configure-projects-for-typescript. But maybe there is solution already available. Or you can like this uservoice if you agree that it is an annoying problem :)

like image 543
VorobeY1326 Avatar asked May 21 '17 13:05

VorobeY1326


1 Answers

Found solution on uservoice (https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/13420095-ask-to-configure-projects-for-typescript).

Seems a bit ugly but it works.

Steps to fix:

  1. Add some ts file to project and let VS add some bullshit to your csproj
  2. ctrl-shift-s to make sure csproj is updated
  3. Open csproj in any text editor and then:
    1. Find import of Microsoft.TypeScript.Default.props and replace it's Condition="..." to Condition="false"
    2. Remove line with TypeScriptToolsVersion
    3. Find import of Microsoft.TypeScript.targets and replace it's Condition="..." to Condition="false"

Now after adding file VS will stop trying to do smth with project. And typescript will not be compiled on save and build, so you need to use gulp/webpack/grunt/whatever.

like image 141
VorobeY1326 Avatar answered Oct 22 '22 03:10

VorobeY1326