fix(formatter): incorrect JSX text wrapping when the expression container is an arrow function that will break#17445
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #17445 will not alter performanceComparing Summary
Footnotes
|
|
I've tested this PR in the opencode repo, and it works well. I am going to merge this without reviewing since leaysgur is on holiday. |
Merge activity
|
…iner is an arrow function that will break (#17445) close: #16956 The mismatch is caused by the expression container (which is an arrow function here) not being wrapped by a `group` compared to Prettier. After grouping, the output turns into the same. Input: ```jsx <p> Current usage for is ${(() => { // })()}. </p> ``` Before output: ```jsx <p> Current usage for is ${(() => { // })()}. </p>; ``` After output: ```jsx <p> Current usage for X is $ {(() => { // comment })()} . </p>; ``` [Prettier output](https://prettier.io/playground/#N4Igxg9gdgLgprEAuEAeADgPgDpQAR4DCArgE6kIx7EDOAhgOZx4BmEpeAljXgCTAAKAQEo8AXkx5guAngD0cmXgC+wkcoB0uVHKwgANCAjoYnaDWSg65CAHcACtYQWUdADa26ATwuGARqR0YADWcDAAynQAtnAAMpxQcMgs7jRwhhB+AFZwYDAA6oHoyCDoFGmkAG5J-oEhYeHoQQkMyDCkxOkgaVGcbR1dcAAe6HCknDGw7gDyo4Ew7PYQNJym0CUIACYGIMNzE5TuACpjUNaccC4pbmmGK1AMbnAAisQQ8MmpXVk0Q+EtT1e7ySSGutxAAEc3vB7KRjC4QHQaABaRJwTbonbtOicNwtQgQKJROgldxuHb3R5wACCMHanD8xBhY3iiU+Ny6AAsYFE3PlOatLk0wHBws5VpxKqsvCUwDRfCBKp0AJJQDGwcJgcYmalq8IwLxPdngsrLOCFOjFFBlS5jao7LbTFiskEgNwsHYJCowWGMYnGrpNUgVEp+Oh+OBuZEwBVlBIFTibGCc5AARlTAAZDBQoZwKL6GP7QV9DDBw-lE8nkAAmQy0OBHcNXEu7KIRzYYzaxOgPYiMOAAMXYxLpLVJTIgIGUyiAA): ```js <p> Current usage for is $ {(() => { // })()} . </p>; ```
a93d02b to
42ad9d6
Compare
5d9ddca to
1bf0ffc
Compare

close: #16956
The mismatch is caused by the expression container (which is an arrow function here) not being wrapped by a
groupcompared to Prettier. After grouping, the output turns into the same.Input:
Before output:
After output:
Prettier output: