📝 Line comment for case:
statement is dissociated by unstable formatting
#2786
Labels
A-Formatter
Area: formatter
L-JavaScript
Language: JavaScript and super languages
S-Bug-confirmed
Status: report has been confirmed as a valid bug
Environment information
Reproduces in playground (presumably v1.7.3).
Configuration
Default config.
Playground link
https://biomejs.dev/playground/?code=ZgB1AG4AYwB0AGkAbwBuACAAYwBvAG8AbAAoAHgAKQAgAHsACgAgACAAcwB3AGkAdABjAGgAIAAoAHgAKQAgAHsACgAgACAAIAAgAGMAYQBzAGUAIAA0ADoAIAAvAC8AIABnAHUAYQByAGEAbgB0AGUAZQBkACAAdABvACAAYgBlACAAcgBhAG4AZABvAG0ACgAgACAAIAAgAGMAYQBzAGUAIAA0ADIAOgAgAC8ALwAgAGMAbABhAHMAcwBpAGMACgAgACAAIAAgAGMAYQBzAGUAIAAxADMAMwA3ADoAIAAvAC8AIABFAEwASQBUAEUACgAgACAAIAAgAHsACgAgACAAIAAgACAAIABjAG8AbgBzAG8AbABlAC4AbABvAGcAKAAiAHgAIABpAHMAIABjAG8AbwBsACIAKQA7AAoAIAAgACAAIAAgACAAYgByAGUAYQBrADsACgAgACAAIAAgAH0ACgAgACAAIAAgAGQAZQBmAGEAdQBsAHQAOgAgAHsACgAgACAAIAAgACAAIABjAG8AbgBzAG8AbABlAC4AZQByAHIAbwByACgAIgB4ACAAaQBzACAAbgBvAHQAIABjAG8AbwBsACIAKQA7AAoAIAAgACAAIAB9AAoAIAAgAH0ACgB9AA%3D%3D
… is reformatted into:
However, this is not stable. Running the formatter again produces:
The comment now appears to refer to the contents of the case block rather than the case statement. I would suggest that the original formatting is preserved, else it becomes impossible to annotate the final case statement in a situation like this.
Code of Conduct
The text was updated successfully, but these errors were encountered: