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 onlyRemoveTypeImports
option to transform-typescript
#11173
Add onlyRemoveTypeImports
option to transform-typescript
#11173
Conversation
d9b4e19
to
ee1639a
Compare
32bb4b8
to
eaf03cc
Compare
@kaicataldo I have rebased Don't forget to |
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.
WDYT rename the option to onlyRemoveTypeImports
or onlyElideTypeImports
?
|
Kai doesn't like using newly learned words! 😛 |
Maybe I did know the word at some point and it was elided from my vocabulary. |
Could you also add tests for |
Merged into #11171 |
onlyRemoveTypeImports
option to transform-typescript
We also need
|
* [plugin-transform-typescript]: onlyExplicitTypeImports * onlyExplicitTypeImports -> onlyRemoveTypeImports * Add test for exceptions
* Add support for type only imports in TS (#11053) * Implement "export type {}" (#11122) * Add "exportKind: type" when needed with TS (#11157) * Add `onlyRemoveTypeImports` option to `transform-typescript` (#11173) * Add onlyRemoveTypeImports to preset-typescript (#11179) Co-authored-by: Brian Ng <bng412@gmail.com> Co-authored-by: Raja Sekar <rajasekarm.dev@gmail.com> Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com> Co-authored-by: Kai Cataldo <kai@kaicataldo.com> Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com> Co-authored-by: Henry Zhu <smiley.we@gmail.com> Co-authored-by: Siddhant N Trivedi <sidntrivedi012@gmail.com>
This is based on the
feat-7.9.0/ts-import-type
branch, and I believed the test failures are from that branch.With the addition of type-only imports and exports to TypeScript, we are now able to explicitly mark imports as types. This PR adds an
onlyExplicitTypeImports
option toplugin-transform-typescript
, which allows the user to opt into only removing imports that are unambiguously types. We will probably want to make this the default behavior in the future.Questions for reviewers:
false
?