-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Labels
area:idempotencyIssues with re-printing Prettier’s outputIssues with re-printing Prettier’s outputlang:jsxIssues affecting JSX (not general JS issues)Issues affecting JSX (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 3.4.1
Playground link
# Options (if any):
--print-width 80
--tab-width 2
Input:
function HelloWorld() {
return (
<div>
<div>
foo
<br />
bar{' '}
<span className="font-semibold">
foobar foobar foobar foobar 12345
</span>, foobar foobar foobar
</div>
</div>
)
}
function HelloWorld() {
return (
<div>
<div>
foo
<br />
bar{' '}
<span className="font-semibold">foobar foobar foobar foobar 12345</span>
, foobar foobar foobar
</div>
</div>
)
}
Output:
function HelloWorld() {
return (
<div>
<div>
foo
<br />
bar{" "}
<span className="font-semibold">foobar foobar foobar foobar 12345</span>
, foobar foobar foobar
</div>
</div>
);
}
function HelloWorld() {
return (
<div>
<div>
foo
<br />
bar{" "}
<span className="font-semibold">
foobar foobar foobar foobar 12345
</span>, foobar foobar foobar
</div>
</div>
);
}
Expected output:
Either one but consistently the same
Why?
The same code keeps alternating between 2 possible outputs on every execution. Both outputs are reported as invalid tho, leading to the format checking never passing. It looks like a regression on 3.4, given that the same code format was stable previously.
Metadata
Metadata
Assignees
Labels
area:idempotencyIssues with re-printing Prettier’s outputIssues with re-printing Prettier’s outputlang:jsxIssues affecting JSX (not general JS issues)Issues affecting JSX (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.