Reproduces in playground (presumably v1.7.3).
Default config.
function cool(x) {
switch (x) {
case 4: // guaranteed to be random
case 42: // classic
case 1337: // ELITE
{
console.log("x is cool");
break;
}
default: {
console.error("x is not cool");
}
}
}
β¦ is reformatted into:
// β¦
case 42: // classic
case 1337: { // ELITE
console.log("x is cool");
// β¦
However, this is not stable. Running the formatter again produces:
// β¦
case 42: // classic
case 1337: {
// ELITE
console.log("x is cool");
// β¦
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.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too