Fix unstable trailing comment in parenthesized sequence or assignment expression (#19263)

Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
Sarath Francisandfisker authored and GitHub committed 2026-06-03 05:52:34 +08:00
1 parent 0926c3e9c4
commit 37255cd58b
6 files changed
+122 -33

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
#### Keep trailing comments inside the parentheses of a sequence or assignment expression (#19263 by @sarathfrancis90)
<!-- prettier-ignore -->
```jsx
// Input
const x = (a, b, c /* comment */);
const y = (a = b /* comment */);
// Prettier stable
const x = (a, b, c) /* comment */;
const y = (a = b) /* comment */;
// Prettier main
const x = (a, b, c /* comment */);
const y = (a = b /* comment */);
```