The change in #1120 means Prettier will now fill a line with as many JSX children as possible before moving to a new line.
This behaviour means that our decision to always have {" "} appear on a line by itself can appear strange in a number of cases.
For example:
x =
<div>
Lorem ipsum dolor <b>sit</b> amet, vix at vitae atomorum, mel ne semper epicuri. Mei cu dolor partem, ne sed feugiat ornatus eligendi. Modus <b>aliquip</b> ea vix. Ad falli adipiscing adversarium ius, mel iusto soluta corpora at, quando <b>dolore</b> ut has. Animal posidonium an eum. Mea accusam detracto eu, no civibus rationibus pro.
</div>
Becomes:
x = (
<div>
Lorem ipsum dolor <b>sit</b> amet, vix at vitae atomorum, mel ne semper
epicuri. Mei cu dolor partem, ne sed feugiat ornatus eligendi. Modus
{" "}
<b>aliquip</b> ea vix. Ad falli adipiscing adversarium ius, mel iusto soluta
corpora at, quando <b>dolore</b> ut has. Animal posidonium an eum. Mea
accusam detracto eu, no civibus rationibus pro.
</div>
);
Potentially it would be nicer formatted as:
// Newline on tag in long text.
x = (
<div>
Lorem ipsum dolor <b>sit</b> amet, vix at vitae atomorum, mel ne semper
epicuri. Mei cu dolor partem, ne sed feugiat ornatus eligendi. Modus
{" "}<b>aliquip</b> ea vix. Ad falli adipiscing adversarium ius, mel iusto
soluta corpora at, quando <b>dolore</b> ut has. Animal posidonium an eum.
Mea accusam detracto eu, no civibus rationibus pro.
</div>
);
I'm not sure how to accomplish this yet, so I've opened this issue as a place to discuss whether we'd like to make this change and how we might accomplish it.
The change in #1120 means Prettier will now fill a line with as many JSX children as possible before moving to a new line.
This behaviour means that our decision to always have
{" "}appear on a line by itself can appear strange in a number of cases.For example:
Becomes:
Potentially it would be nicer formatted as:
I'm not sure how to accomplish this yet, so I've opened this issue as a place to discuss whether we'd like to make this change and how we might accomplish it.