-
Notifications
You must be signed in to change notification settings - Fork 448
Use and import as types.d.ts #2125
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR! This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks to me like it just added 2 new letters and the type
. I don't see why this is beneficial.
Reducing to a type import is nice. From @jakebailey
Has this flag been set? But changing to an |
We are not adding a TypeScript file import in runtime (which would require node.js experimental flag), or I'm still confused what he tried to say... |
Jake's comment:
I think he meant the TS flag/config allowImportingTsExtensions which allows importing |
This is pretty atypical. Auto imports will never suggest these paths, and for more real published packages, you'd want to avoid this because you'd end up with files that are unimportable because there's no JS file left to do it. I don't even remember if these d.ts input files are even written back out to the output...
FWIW running TS directly is no longer experimental in 22/24, so I would honestly consider just using a higher minimum in the repo and just use that feature (with requisite tsconfig options). It works well. |
I don't understand the reason behind #2108 (comment), this works perfectly?