Open Conaclos opened 3 months ago
Yeah, that's a tough one. Maybe the formatter shouldn't move suppression comments.
Yeah, that's a tough one. Maybe the formatter shouldn't move suppression comments.
Another possibility is to allow suppression comments to cover a parent node. This could also allow users to suppress a rule at a function level for example. However, I am not sure if it is easily doable with the current implementation of suppression comments.
Environment information
What happened?
Originally posted here: https://github.com/rome/tools/issues/3734
Consider the following code:
The
biome-ignore
comment works as intended.However, as the playground shows, the formatter introduces parentheses around the
&&
logic:This disconnects the
biome-ignore
comment, which in turn causes the linter to error again.Expected result
The suppression comment should be taken into account after the code is formatted.
Code of Conduct