Handle comments in export declarations between type and type name. (#19565)

This commit is contained in:
Kirk Waiblinger authored and GitHub committed 2026-07-08 07:25:26 +08:00
1 parent 62ccd0d9bf
commit a7ce99aa57
4 files changed
+48 -3

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
#### Fix comments being dropped on shorthand `type` import/export specifiers (#19565 by @kirkwaiblinger)
<!-- prettier-ignore -->
```tsx
// Input
export { type /* comment */ T } from "foo";
import { type /* comment */ T } from "foo";
// Prettier stable
Error: Comment "comment" was not printed. Please report this error!
// Prettier main
export { type /* comment */ T } from "foo";
import { type /* comment */ T } from "foo";
```