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

Add option to override compiler options #137

Open
timocov opened this issue Sep 27, 2020 · 7 comments
Open

Add option to override compiler options #137

timocov opened this issue Sep 27, 2020 · 7 comments

Comments

@timocov
Copy link
Owner

timocov commented Sep 27, 2020

From #135 (comment)

@timocov
Copy link
Owner Author

timocov commented Apr 10, 2021

It seems that TypeScript doesn't provide types for the compiler options which are inside json file (ts.CompilerOptions are options after processing and converting them), so it seems that the only option we have is set it to any in types 😞

@bluelovers
Copy link
Contributor

It seems that TypeScript doesn't provide types for the compiler options which are inside json file (ts.CompilerOptions are options after processing and converting them), so it seems that the only option we have is set it to any in types 😞

https://github.com/bluelovers/ws-ts-type/blob/master/packages/package-dts/tsconfig-json.d.ts

@timocov
Copy link
Owner Author

timocov commented Aug 12, 2021

@bluelovers are these types auto-generated/related to the compiler's code and just manually-written and have to be updated on every TypeScript release?

@keyiis
Copy link

keyiis commented Mar 13, 2022

@timocov I fork your repo and added compilerOptions,please check #189

@timocov
Copy link
Owner Author

timocov commented Mar 27, 2022

@keyiis it is not a problem to provide a way to override compiler options and just add an option for that. The problem we're facing right now is that it seems that it is impossible to provide proper types for that. If you use any it increases a chance to make a mistake or work with the tool incorrectly. This is the same if you don't use types at all (good example for this is this issue where the compiler would tell you that the options are incorrect). Right now it is much easier to create another tsconfig in your project that will extend your current one and override all the options there.

So to conclude the future of this ticket: until we don't have a proper way to describe types of the compiler options in the API it is the best way to create a tsconfig in your project (e.g. tsconfig.dts.json or so) that will extend your current config (see extends) and override options there.

@keyiis
Copy link

keyiis commented Apr 1, 2022

@timocov I see what you mean, but my compilerOptions is dynamic and can't use fixed file description.

@timocov
Copy link
Owner Author

timocov commented Apr 2, 2022

@keyiis as workaround I can suggest to write temporary file in your scripts and provide it as a tsconfig and then remove it later. We're here for types and it would be bad to provide any anywhere in the API or incorrect types IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants