-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
module: Preserve #29
Comments
What's the benefit for ESM-only projects? Not sure I see the value in it. |
I think the benefit is to stop fighting TypeScript with imports: just let the user use what they write. Specific rules/preferences can be enforced via eslint. Or at least that’s the promise |
There is really no fighting if you are pure ESM. And I don't really see the point in allowing |
I reached this point because this config blocks import attributes AKA “pure ESM”, so the fight still exists. Then node wants .ts imports and TS wants .js imports. The fight continues. If |
I suggest trying it out in practice first on some popular projects to see its effects. I'm already lukewarm to it, but I'm definitely not adding it here until it's proven to work. |
That's just the fact of using TS in general. Every JS feature has to be supported by TS before you can use it there. I thought TS already supported import attributes: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html |
They do, but you have to use a specific config (and this config particularly blocks |
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-4.html#support-for-require-calls-in---moduleresolution-bundler-and---module-preserve
I think this is the right config to finally get TS out of the way
More info in microsoft/TypeScript#56785
The text was updated successfully, but these errors were encountered: