-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Current tsconfig naming is problematic w.r.t. VSCode (and other IDEs) #5175
Comments
Btw, the same thing happens with other compiler options (such as target!). |
Some of the things requested here were fixed in 1.0.0-rc1 via #5046/#5060 (es5 target and dom lib). This is still open to questions maybe… not sure. @filipesilva, I see you were the one fixing the above issue, should this be closed or do you think the rest of the issue will result on some actions? |
Still not working for me |
@nickiewooster you need to update your project :) I think the bug fix is only for new project. |
(I mean updating you tsconfig.json file) |
@nickiewooster sorry, what was your problem originally? Just to be clear :) I thought you had the same one as me with the IDE, not the compilation :) |
@nickiewooster also, if you need the dom library for your test, feel free to add it, but if I understood well, from the point of view of default newly created angular project, adding the dom lib to the tests is not needed. It should only be present in the application itself. |
Sorry i was referred here from another thread and got a bit mixed up. You're right the tsconfig modification alone will fix the IDE errors |
@victornoel it was intentional to only have one tsconfig with the a name that would be recognized by the IDE. This was our solution to the problem where For the sake of consistency we change all tsconfigs to specify their purpose and left the general tsconfig on top. There were a couple more solutions we considered but at the end of the day settled on this one because it was the simpler to understand. Failing to include the es5 target and dom lib was just a mistake on my part though. |
@filipesilva ok, thanks for taking the time to explain! So I guess we can simply close this issue now that it was fixed in rc1 :) |
On compiling, I now get the error |
@Ionaru you might need to add it to the |
It worked when I used |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
archlinux latest
Versions.
Repro steps.
app created with the cli
Mention any other details that might be useful.
It seems that the choice was made to name tsconfigs as:
./src/tsconfig.app.json
./src/tsconfig.spec.json
./e2e/tsconfig.e2e.json
All extending
./tsconfig.json
.The problem with this is well explained in the following tickets of vscode and typescript:
tsconfig.json
files in subdirectories microsoft/vscode#10084Basically, vscode is expecting a file named
tsconfig.json
in a given directory (and multiple can be used, but in different directories).Currently what happens with angular-cli, is that only the parent
tsconfig.json
is used by vscode, and thus libraries are missing because only declared intsconfig.app.json
(or one of the others).It would make sense to at least rename
./e2e/tsconfig.e2e.json
to./e2e/tsconfig.json
and./src/tsconfig.app.json
to./src/tsconfig.json
. Or maybe it is possible to tell vscode this but I didn't find how…And then, I think we are blocked for now concerning the specs files since they are in the same directory as the app files. In the above issues, Microsoft people recommend to have two directory, one for the tests and one for the application.
The text was updated successfully, but these errors were encountered: