Add onlyRemoveTypeImports option to transform-typescript#11173
Merged
nicolo-ribaudo merged 3 commits intobabel:feat-7.9.0/ts-import-typefrom Feb 26, 2020
Merged
Conversation
d9b4e19 to
ee1639a
Compare
32bb4b8 to
eaf03cc
Compare
Member
|
@kaicataldo I have rebased Don't forget to |
existentialism
approved these changes
Feb 26, 2020
JLHwung
reviewed
Feb 26, 2020
Contributor
JLHwung
left a comment
There was a problem hiding this comment.
WDYT rename the option to onlyRemoveTypeImports or onlyElideTypeImports?
Member
Author
|
|
Member
|
Kai doesn't like using newly learned words! 😛 |
Member
Author
|
Maybe I did know the word at some point and it was elided from my vocabulary. |
Member
|
Could you also add tests for |
nicolo-ribaudo
approved these changes
Feb 26, 2020
Member
|
Merged into #11171 |
onlyRemoveTypeImports option to transform-typescript
Contributor
|
We also need
|
This was referenced Feb 27, 2020
nicolo-ribaudo
pushed a commit
that referenced
this pull request
Mar 2, 2020
* [plugin-transform-typescript]: onlyExplicitTypeImports * onlyExplicitTypeImports -> onlyRemoveTypeImports * Add test for exceptions
nicolo-ribaudo
added a commit
that referenced
this pull request
Mar 16, 2020
* 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is based on the
feat-7.9.0/ts-import-typebranch, 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
onlyExplicitTypeImportsoption 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?