Prettier 3.8.1
Playground link
Input:
https://github.com/prettier/prettier/blob/812a4d0071270f61a7aa549d625b618be7e09d71/tests/format/js/comments/empty-statements.js#L1-L21
a; /* a */ // b
; /* c */
foo; // first
;// second
;// third
function x() {
} // first
; // second
Output:
a; /* a */ // b
/* c */
foo; // first
// second
// third
function x() {} // first
// second
Expected output:
a; /* a */ // b
/* c */
foo; // first
// second
// third
function x() {} // first
// second
Why?
Should be the same as a non-empty statement to maintain consistency
Prettier 3.8.1
Playground link
Input:
https://github.com/prettier/prettier/blob/812a4d0071270f61a7aa549d625b618be7e09d71/tests/format/js/comments/empty-statements.js#L1-L21
Output:
Expected output:
Why?
Should be the same as a non-empty statement to maintain consistency