Fix unstable trailing comment in parenthesized sequence or assignment expression (#19263)
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
1 parent
0926c3e9c4
commit
37255cd58b
6 files changed
+122
-33
No files matched your search
@@ -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 */);
|
||||
```
|
||||
Reference in new issue
Block a user