Prettier v3.9.4
Playground link
Input:
// --- OK ---
if (a) {/*c*/}
while (a) {/*c*/}
// --- NG? ---
switch (a) {/*c*/}
Output:
// --- OK ---
if (a) {
/*c*/
}
while (a) {
/*c*/
}
// --- NG? ---
switch (a /*c*/) {
}
Expected output:
// --- OK ---
if (a) {
/*c*/
}
while (a) {
/*c*/
}
// --- NG? ---
switch (a) {
/*c*/
}
Why?
Comment should stay inside of empty block.
Prettier v3.9.4
Playground link
Input:
Output:
Expected output:
Why?
Comment should stay inside of empty block.