Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent Visual Studio's tsconfig detection from detecting tsconfigs in other projects?

TypeScript Version:

1.8.30.0

Issue

We have a solution with a number of web projects. We recently made a new project which used a tsconfig.json file.

This affected other projects to believe they had a tsconfig.json file, overriding our project typescript settings for those projects.

"One or more tsconfig.json files detected. Project properties are disabled."

I've checked and the project file itself does not contain any reference to any tsconfig.json files nor does the project folder contain a tsconfig file.

Reproduce

  1. Create two new Web Api projects in same solution.
  2. Add a typescript file to each project and accept that they are converted into a typescript project.
  3. Add a tsconfig.json to the second project.
  4. Open properties for the first project and go to the TypeScript Build Tab. Observe "One or more tsconfig.json files detected. Project properties are disabled."

How do I prevent a Visual Studio 2015 project from finding / detecting tsconfig.json files that are in another project folder?

like image 672
Daniel Møgelgaard Pedersen Avatar asked May 18 '16 11:05

Daniel Møgelgaard Pedersen


People also ask

Can you have multiple Tsconfig files?

You could use multiple tsconfig files to solve some of those problems, but new ones would appear: There's no built-in up-to-date checking, so you end up always running tsc twice.

How does Tsconfig work?

The tsconfig.json file specifies the root files and the compiler options required to compile the project. JavaScript projects can use a jsconfig.json file instead, which acts almost the same but has some JavaScript-related compiler flags enabled by default.

Where is Tsconfig json is located?

The tsconfig. json is generally put in the root folder of the project.


1 Answers

I had this problem also. I solved it by this:

  1. Open Solution Explorer
  2. Right click on the tsconfig.json file and choose 'Exclude From Project'.
  3. You might see the tsconfig.json disappear from the Solution Explorer. In that case choose 'Show All Files' option from the top of the Solution Explorer toolbar.
  4. Right click on the tsconfig.json and choose 'Include In Project'.
like image 123
zapping Avatar answered Oct 17 '22 03:10

zapping