-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Possible problem with multiple tsconfig.json
files in subdirectories
#10084
Comments
I was able to reproduce this. |
The problem is that the code inside the mySubProject folder doesn't see the code in the typings folder. The compiler only looks from the tsconfig.json file downwards. If you want to keep your layout you can do the following: add a file typings.d.ts with the following content to the MySubProject folder
This makes it work correctly. |
Thank you @dbaeumer for that hint. I have solved the problem by removing/renaming the second My main point was that the VSCode is not consistent and it looks like a bug:
What's more, logically when I compile the top project with I guess the problem is in the The more I think about the problem, I am inclined to the opinion that it is a BUG in
@dbaeumer I read again your answer and I'm not sure you saw that in this test project are TWO I totaly agree and understand that compiler is looking only downwards but I think it should start with the same path as |
I do understand that the project has two tsconfig.json files and the problem is a misalignment between the tsc and the tsserver in terms of the project team. I will move the issue to the TS to comment on. For the TS team:
This results in different project scopes. |
This issue was moved to microsoft/TypeScript#10283 |
@dbaeumer sorry I was raising the problem again, I would like the tool I use every day was perfect for everyone :) I appreciate the work of all team, thanks a lot! |
Please see the demonstration project on git: https://github.com/a8775/vscode-tsconfig
Setup
Tested with the following versions:
Steps to reproduce the problem:
npm install
- to download dependenciestypings install
- to download required typings filesTypeScript
In working directory run the command:
tsc -p .
Should compile correctly.
vscode
Select the right file in a editor window and compile the project:
./MySubProject/mySubProjectFile.ts
Ctrl-Shift-B
The project should be compiled without errors.
Now press space in any syntactically correct place. You get compilation errors.
The text was updated successfully, but these errors were encountered: