Prettier 2.5.1
Playground link
Input:
if (a === 0) doSomething(); // comment A
else if (a === 1) doSomethingElse(); // comment B
else if (a === 2) doSomethingElse(); // comment C
Output:
if (a === 0) doSomething();
// comment A
else if (a === 1) doSomethingElse();
// comment B
else if (a === 2) doSomethingElse(); // comment C
Expected behavior:
Input is preserved as it is.
Comments at the end of line are put below the line with formatting, except the last statement.
Related issues:
This weird behavior around end of line comments have been reported before:
#807
#7155
#8708
#10250
Prettier 2.5.1
Playground link
Input:
Output:
Expected behavior:
Input is preserved as it is.
Comments at the end of line are put below the line with formatting, except the last statement.
Related issues:
This weird behavior around end of line comments have been reported before:
#807
#7155
#8708
#10250