Skip to content

fix: Remove empty curly brackets while verbatimModuleSyntax is on onl…#62349

Closed
codenamenam wants to merge 2 commits intomicrosoft:mainfrom
codenamenam:fix/62239
Closed

fix: Remove empty curly brackets while verbatimModuleSyntax is on onl…#62349
codenamenam wants to merge 2 commits intomicrosoft:mainfrom
codenamenam:fix/62239

Conversation

@codenamenam
Copy link
Copy Markdown

@codenamenam codenamenam commented Aug 28, 2025

…y if default import is used with named import

This PR fixes an issue where verbatimModuleSyntax would leave empty curly braces {} in the JavaScript output when an import statement has a default import and all of its named imports are type-only.

The transformer logic is updated to check for the presence of a default binding on the import code.

Fixes #62239

…y if default import is used with named import
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Aug 28, 2025
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 28, 2025
@jakebailey
Copy link
Copy Markdown
Member

This PR needs tests.

Copy link
Copy Markdown
Member

@RyanCavanaugh RyanCavanaugh left a comment

Choose a reason for hiding this comment

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

@copilot add some tests

@github-project-automation github-project-automation bot moved this from Not started to Waiting on author in PR Backlog Sep 25, 2025
@codenamenam
Copy link
Copy Markdown
Author

@jakebailey @RyanCavanaugh I added test case which verifies that empty braces are correctly removed from an import statement with a default binding and only type-only named bindings when verbatimModuleSyntax is enabled. If you have any questions, please let me know. Thank you!

@github-project-automation github-project-automation bot moved this from Waiting on author to Needs merge in PR Backlog Sep 26, 2025
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Mar 24, 2026
@typescript-bot
Copy link
Copy Markdown
Collaborator

With 6.0 out as the final release vehicle for this codebase, we're closing all PRs that don't fit the merge criteria for post-6.0 patches. If you think this was a mistake and this PR fits the post-6.0 patch criteria, please post to the 6.0 iteration issue with details (specifically, which PR and which patch criteria it satisfies).

Next steps for PRs:

  • For crash bugfixes or language service improvements, PRs are currently accepted at the typescript-go repo
  • Changes to type system behavior should wait until after 7.0, at which point mainline TypeScript development will resume in this repository with the Go codebase
  • Library file updates (lib.d.ts etc) continue to live in this repo or the DOM Generator repo as appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

verbatimModuleSyntax leaves empty curly brackets in the JS output

4 participants