Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings in tsconfig.json file not being applied if tsconfig.json is in a subdirectory rather than root #4466

Closed
ChrisPearce opened this issue Mar 20, 2016 · 3 comments
Assignees

Comments

@ChrisPearce
Copy link

  • VSCode Version: 0.10.11
  • OS Version: OS X 10.11.3

Steps to Reproduce:

  1. Place a tsconfig.json file in a subdirectory rather than in root (e.g. /src/tsconfig.json)
  2. Ensure tsconfig.json contains "experimentalDecorators": true
  3. Create a TypeScript file (under /src) that uses decorators
  4. Visual Studio Code incorrectly displays an error regarding "Experimental support for decorators..."
  5. If the tsconfig.json is moved to the root directory (and VS Code is then restarted) the error is no longer displayed
@Tyriar
Copy link
Member

Tyriar commented Mar 20, 2016

According to the TypeScript wiki:

The presence of a tsconfig.json file in a directory indicates that the directory is the root of a TypeScript project.

Because of this I don't think vscode should attempt to go further down the folder structure, this is how it works for .eslintrc and other similar config files too.

Closing as designed.

@Tyriar Tyriar closed this as completed Mar 20, 2016
@httpdigest
Copy link

It sure would be desirable to have this feature, seeing that @angular/cli is using the 'tsconfig.json inside src/ folder' scheme. And with the recent 1.0.0 release candidates, there are even multiple tsconfig*.json files under src/ for different build variants. It only seems to be keeping a root tsconfig.json around to satisfy tools such as Visual Studio Code that do not respect tsconfig.json files in subdirectories.
For example, if there was a /tsconfig.json, a /src/tsconfig.json and a /src/app/app.ts, I'd expect vscode to use the /src/tsconfig.json file when autocompleting and building /src/app/app.ts.

@mjbvz
Copy link
Contributor

mjbvz commented Mar 7, 2017

@httpdigest We do pick up tsconfig.json files in subdirectories and treat those subdirectories as individual projects. If you are not seeing the correct behavior around this, please open a new issue and I can take a look

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants