Closed lgarron closed 1 year ago
Note that if you modify the sample code by moving the // rome-ignore format
comment one line up, this issue doesn't occur. So I can easily work around it. But I thought I'd file a bug to save others the headache, if this can be fixed.
Environment information
What happened?
Consider the following code, meant to work around https://github.com/rome/tools/issues/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