This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
🐛 Formatter introduces infinite parentheses around certain logic expressions over time #3735
Closed
1 task done
Labels
A-Formatter
Area: formatter
L-JavaScript
Langauge: JavaScript
S-Bug: confirmed
Status: report has been confirmed as a valid bug
Environment information
What happened?
Consider the following code, meant to work around #3734 :
This successfully prevents the formatter from breaking the
// rome-ignore
, but it seems Rome's formatter is not idempotent — it adds new parentheses on every formatting invocation. After a few runs ofnpx rome format
you get:This is kind of hilarious when formatting on save, but I presume it's not intended behaviour.
Expected result
Rome's formatter is idempotent — in this case, if it adds parentheses then subsequent invocations keep the exact same parentheses without adding more.
(The parentheses are redundant in this particular case, though.)
Code of Conduct
The text was updated successfully, but these errors were encountered: