Fix duplicate dangling comments in experimental ternaries (#18963)

This commit is contained in:
Konv Suu authored and GitHub committed 2026-04-12 07:39:08 +08:00
1 parent 5ad0f9c4e9
commit 3031cd3b84
4 files changed
+184 -18

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
#### Fix duplicated comments in empty branches with `experimentalTernaries` (#18963 by @kovsu)
<!-- prettier-ignore -->
```jsx
// Input
condition ? ifTrue
: [
// Hello, world!
];
// Prettier stable (--experimental-ternaries)
condition ? ifTrue
// Hello, world!
: (
[
// Hello, world!
]
);
// Prettier main (--experimental-ternaries)
condition ? ifTrue : (
[
// Hello, world!
]
);
```