-
Notifications
You must be signed in to change notification settings - Fork 12.8k
noImplicitAny from parent tsconfig.json cannot be overridden #55983
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
Comments
😱 |
I'm not sure what the repro is supposed to be showing. When I run |
It seems like maybe you're expecting that if a file from the root tsc imports a file which has a |
This is genius. I've been looking for a nice, succinct term for "...in any directory whose path is a substring of this given one" for years. "...in the directory spine of" describes that perfectly. |
@RyanCavanaugh there is a main And to reiterate, I am not sure this is a TypeScript or an Angular issue, because I'm not invoking the TypeScript compiler directly, I'm invoking the Angular cli/compiler. |
Right, and as Ryan explained, it doesn’t work that way. When you invoke tsc, you invoke it on one particular tsconfig at a time, and all source files that are part of that run, whether through What you’re trying to do requires either |
@fatcerberus thanks for the explanation @fatcerberus , sorry but I didn't get it the way @RyanCavanaugh explained it. Is it possible that the Angular compiler (ngc) invokes tsc internally with separate processes, respecting the individual settings? Do you think I might have better luck posting the issue there? |
This issue has been marked as "Question" and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
🔎 Search Terms
noImplicitAny
🕗 Version & Regression Information
⏯ Playground Link
No response
💻 Code
https://github.com/digeomel/angular-no-implicit-any
🙁 Actual behavior
I have an Angular 15 workspace with a main app and multiple independent projects (aka libraries). For the main app and some projects, I want to set
noImplicitAny: true
for the TypeScript compiler, but for some others, I want it to remainfalse
(the default). Thetsconfig.lib.json
files inside the libraries are extending the maintsconfig.json
from the root Angular folder (although I tried removing theextends
as well, no difference, read below).The problem is, no matter what I do, I keep getting errors about
noImplicitAny
from the libraries where it is even explicitly set to false! It seems that the TypeScript compiler disregards the individualtsconfig.lib.json
settings inside those libraries and takes the global setting.Moreover, I tried moving the setting from the main
tsconfig.json
in the root folder, to the app-specificsrc/tsconfig.app.json
and I still get the same error from the libraries!These are the other contents of the main
tsconfig.json
file:We are not using "full" TypeScript strict mode.
What am I missing?
🙂 Expected behavior
I expect that the TypeScript compiler will respect the individual project settings and overrides. In my example above, the
test2
library has thistsconfig.lib.json
:So,
noImplicitAny
is set to false, however I'm getting an error intest2.component.ts
:Additional information about the issue
Not sure if this is about the Angular compiler or the TypeScript compiler, if you think it's Angular, please close the issue and I will post it in the Angular repo issues.
I also posted this on stackoverflow, with no luck, that's why I'm trying here as well:
https://stackoverflow.com/questions/77214574/angular-tsconfig-cannot-use-different-noimplicitany-settings-for-different-proje
The text was updated successfully, but these errors were encountered: