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

@@ -116,6 +116,16 @@ import type { foo as bar } from 'baz';
import type * as foo from './bar';
import type foo from 'bar';
// https://github.com/prettier/prettier/issues/19564
export { type /* comment */ T } from 'foo';
import { type /* comment */ T } from 'foo';
export { /* e1 */ type /* e2 */ T /* e3 */ } from 'foo';
import { /* i1 */ type /* i2 */ T /* i3 */ } from 'foo';
export { /* e1 */ type /* e2 */ T /* e3 */ as /* e4 */ U /* e5 */ } from 'foo';
import { /* i1 */ type /* i2 */ T /* i3 */ as /* i4 */ U /* i5 */ } from 'foo';
=====================================output=====================================
export type { SomeThing };
export type { A as B };
@@ -132,5 +142,15 @@ import type { foo as bar } from "baz";
import type * as foo from "./bar";
import type foo from "bar";
// https://github.com/prettier/prettier/issues/19564
export { type /* comment */ T } from "foo";
import { type /* comment */ T } from "foo";
export { /* e1 */ type /* e2 */ T /* e3 */ } from "foo";
import { /* i1 */ type /* i2 */ T /* i3 */ } from "foo";
export { /* e1 */ type /* e2 */ T /* e3 */ as /* e4 */ U /* e5 */ } from "foo";
import { /* i1 */ type /* i2 */ T /* i3 */ as /* i4 */ U /* i5 */ } from "foo";
================================================================================
`;
@@ -12,3 +12,13 @@ import type { foo, bar } from 'baz';
import type { foo as bar } from 'baz';
import type * as foo from './bar';
import type foo from 'bar';
// https://github.com/prettier/prettier/issues/19564
export { type /* comment */ T } from 'foo';
import { type /* comment */ T } from 'foo';
export { /* e1 */ type /* e2 */ T /* e3 */ } from 'foo';
import { /* i1 */ type /* i2 */ T /* i3 */ } from 'foo';
export { /* e1 */ type /* e2 */ T /* e3 */ as /* e4 */ U /* e5 */ } from 'foo';
import { /* i1 */ type /* i2 */ T /* i3 */ as /* i4 */ U /* i5 */ } from 'foo';