Keep parentheses in yield expression (#19913)

Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
Bao Nguyenandfisker authored and GitHub committed 2026-09-11 06:33:16 +08:00
1 parent c4c3320496
commit f6ddf6e437
6 files changed
+163 -16

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#### Keep necessary parentheses in `yield` expression (#19913 by @giaBaoJS)
<!-- prettier-ignore -->
```jsx
// Input
function* f() {
yield (/*
*/ a);
}
// Prettier stable
function* f() {
yield /*
*/ a;
}
// Prettier main
function* f() {
yield (
/*
*/ a
);
}
```