📝 Wrapped JSX Expressions in Arrow Chains should be parenthesized #1024
Labels
A-Formatter
Area: formatter
L-JavaScript
Language: JavaScript and super languages
S-Bug-confirmed
Status: report has been confirmed as a valid bug
S-Help-wanted
Status: you're familiar with the code base and want to help the project
Description
Playground Link
Arrow chains are almost entirely compatible with Prettier, this seems like the last remaining difference, where JSX expressions that break onto a separate line should get parenthesized, but Biome just puts them on the next line.
Interestingly, it looks like the IR for these is pretty identical between Prettier and Biome, so I think this could be related to what #917 tried to fix. The JSX expression gets interned as part of the
BestFitting
variants, and I think it's assuming that it won't break, so theif_group_breaks
format element doesn't end up rendering the parentheses.But it could also just be that the
if_group_breaks
is looking at the wrong group. The JSX expression itself is on a single line, but the parent obviously breaks.The text was updated successfully, but these errors were encountered: