Fix comment in union type get duplicated (#18393)

This commit is contained in:
fisker Cheung authored and GitHub committed 2025-12-02 01:46:31 +08:00
1 parent cfa92c1b6d
commit 7efb988c67
4 files changed
+87 -1

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
#### Fix comment inside union type get duplicated (#18393 by @fisker)
<!-- prettier-ignore -->
```tsx
// Input
type Foo = (/** comment */ a | b) | c;
// Prettier stable
type Foo = /** comment */ (/** comment */ a | b) | c;
// Prettier main
type Foo = /** comment */ (a | b) | c;
```