Microsoft/TypeScript
Ver no GitHub`verbatimModuleSyntax` leaves empty curly brackets in the JS output
Open
#62.239 aberto em 8 de ago. de 2025
Domain: ES ModulesHelp WantedPossible Improvement
Métricas do repositório
- Stars
- (48.455 stars)
- Métricas de merge de PR
- (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)
Description
🔎 Search Terms
"verbatimModuleSyntax", "curly brackets", "empty brackets"
🕗 Version & Regression Information
- This is the behavior in every 5.x version I tried, and I reviewed the FAQ for entries about
verbatimModuleSyntax
⏯ Playground Link
💻 Code
import Image, {type ImageProps} from "next/image.js";
export default function ImageWrapper(props: ImageProps) {
return <Image {...props}/>
}
🙁 Actual behavior
TS produces the following JS output when verbatimModuleSyntax is set to true:
import { jsx as _jsx } from "react/jsx-runtime";
import Image, {} from "next/image.js";
export default function ImageWrapper(props) {
return _jsx(Image, Object.assign({}, props));
}
Notice the empty curly brackets in the import statement that were left off after removing type-only named imports.
🙂 Expected behavior
The empty curly brackets are unnecessary in this case. It is precisely the output TS produces when verbatimModuleSyntax is not enabled:
import { jsx as _jsx } from "react/jsx-runtime";
import Image from "next/image.js";
export default function ImageWrapper(props) {
return _jsx(Image, Object.assign({}, props));
}
Additional information about the issue
No response