Skip to content

Elide import equals in transpileModule if referenced only by export type - #49664

Merged
Andrew Branch (andrewbranch) merged 3 commits into
microsoft:mainfrom
wnayes:fix-transpile-module-import-equals
Jul 5, 2022
Merged

Elide import equals in transpileModule if referenced only by export type#49664
Andrew Branch (andrewbranch) merged 3 commits into
microsoft:mainfrom
wnayes:fix-transpile-module-import-equals

Conversation

@wnayes

Copy link
Copy Markdown
Contributor

Fixes #49450

See investigation notes in issue. In short, it seems like the removal of the type only "import equals" declaration was not occurring because it relied on type information about the alias itself. We can still elide correctly under transpileModule by noticing when an export declaration is type only.

@ghost

Deleted user (ghost) commented Jun 24, 2022

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

Comment thread src/compiler/checker.ts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right, but could you also add a test and check for export { type IFoo }? It looks like that construct probably needs to be fixed too. Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@andrewbranch
Andrew Branch (andrewbranch) merged commit 501e442 into microsoft:main Jul 5, 2022
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transpileModule does not elide type only "import equals"

3 participants