-
-
Notifications
You must be signed in to change notification settings - Fork 28
fix: Don't include 'import type' in JS output #178
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
Conversation
Thanks for the report and for contributing a fix! That behaviour should already be covered here: We had to copy most of that logic from the TS compiler. This is a place in our code where we have to catch up if TS changes anything fundamentally about that logic. If that part isn't currently working, my guess is something has changed in the compiler. If you're interested in doing a bit of debugging, I'd take a look at that part of our code and see why it's not triggering. If you look at the corresponding code in the TypeScript compiler, it should be evident what's different. My guess is it has something to do with changes to the factory method parameters. I'll hopefully be able to have a look this weekend otherwise. |
I created a minimal reproduction repo for this issue: https://github.com/pkerschbaum/issue-typescript-transform-paths-type-is-included-in-js-output Edit: I tried the fix of this PR and it did not change anything. Maybe because my reproduction repo has the problem with type only imports of named imports, while this PR exists to fix import type in JS output. |
Hello, does this repo still in maintain? |
@JimmyDaddy Yes. Running two companies, so I've been swamped. I have a week set off to catch up on this and all other OSS stuff coming up very soon. |
I have the same bug. |
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.
LGTM
Hey. Sorry. We should be fixing the elision part to match TS changes. The changes here don't address it in the correct way or place. I know I need to catch up on this. I'll check on this Sunday |
🎉 Fixed in the latest release —
|
I ran into an issue where type imports were getting output in Javascript files. For example:
would be included in the
.js
file created by the Typescript compiler.This PR excludes all type imports (
node.importClause.isTypeOnly
) from the output unless the output file is a declaration file.