Prettier 3.8.1
Playground link
Input:
const fn = () => {
return;
} /* foo */;
() => {
return;
} /* foo */
const v = a || b /* bar */;
a || b /* bar */;
Output:
const fn = () => {
return;
}; /* foo */
() => {
return;
}; /* foo */
const v = a || b; /* bar */
a || b /* bar */;
Expected output:
Same as input
const fn = () => {
return;
} /* foo */;
() => {
return;
} /* foo */
const v = a || b /* bar */;
a || b /* bar */;
Why?
Semicolon placement is inconsistent: variable declarations move the semicolon before the comment (}; /* foo */), while expression statements keep it after (} /* foo */;).