Align leading comment of union type elements (#18833)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-02-02 16:04:17 +08:00
1 parent a16e57de94
commit c65761ac3a
5 files changed
+156 -12

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
#### Align JSDoc before union type elements (#18833 by @fisker)
<!-- prettier-ignore -->
```tsx
// Input
type A =
|
/**
* Comment
*/
a
| (b | c);
type A2 =
|
// comment
a
| (b | c);
// Prettier stable
type A =
| /**
* Comment
*/
a
| (b | c);
type A2 =
| // comment
a
| (b | c);
// Prettier main
type A =
| /**
* Comment
*/
a
| (b | c);
type A2 =
| // comment
a
| (b | c);
```