-
Notifications
You must be signed in to change notification settings - Fork 363
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
TSConfig compilerOptions
should have a way to disable defaults
#3437
Comments
Forgot: We can use one of a couple of mechanisms for this. The one mentioned above is to set Another option is to add a side-option like |
Can you explain if simply disabling the TS config and creating your own one would be a suitable solution in this scenario? I'm asking because the issue describes a outcome, not a problem. |
@mrgrain You're right. This was sloppy and I apologize. Disabling the TS config is non-ideal since too much machinery would need rewired, I believe. However, as you said I described the solution but failed to describe the problem, and indeed the solution proposed doesn't solve the full range of problems. I've edited the description on this issue to correct the problem. Did I miss any use-case scenarios? I think something like |
I guess an alternative would be if we could pass in a fully formed |
It does help a lot. Thanks for the clarifications. A real world scenario would also help.
Sure. But is that not the same when you are completely removing From my perspective, the |
There’s many more elements to a TSConfig that’s being managed by The current defaults cover a somewhat narrow target type (node app, basically), which I’m not complaining about, but is somewhat brittle and puts the maintenance burden on this project. Each project subtype (such as a React one) provides overrides, which is great, and this should make that easier as well. In my scenario I’m looking to (not in this issue or PR, just giving context) offer the use of the So, conversationally that would read as: “I’m building for Node20, would like the strictest settings, except Or, “I’m building for React in a browser, and bundling.” That last one brings up the element of |
That sounds great. Can you please start with an RFC issue for this wider feature before moving into smaller feature PRs. That will help us to understand the context of issue like this one much better. |
Problem
Currently
TypeScriptProject
always merges in a set of defaultcompilerOptions
. Of course you can override any of them, so if you want none of them (such as when you're usingextends
instead to providecompilerOptions
from another file) you have to provide overrides for everything that is set in the defaults withundefined
.When using
compilerOptions
in combination withextends
we have three scenarios:compilerOptions
, maybe with a few overrides (current state)extends
to set thecompileOptions
compileOptions
- settingcompilerOptions
toundefined
could solve thisextends
can be an array of files, such asnode18
andstrictest
(ignoring thets-node
bug)extends
to set the basecompileOptions
, and also have acompileOptions
where we specify specific overrides from that extended configcompileOptions
to what's provided"extends": "tsconfig.json"
andinclude
only that one fileThe text was updated successfully, but these errors were encountered: