from: #9324 (comment)
Prettier 2.1.2
Playground link
Input:
class Test {
foo (/* 2 */) /* 3 */;
}
Output:
class Test {
foo /* 3 */(/* 2 */);
}
Expected behavior:
class Test {
foo (/* 2 */) /* 3 */;
}
Additional info:
With typescript parser, #9324 happens.
Playground link
// Input
class Test {
foo (/* 2 */) /* 3 */;
}
// Output
Error: Comment "3" was not printed. Please report this error!
at https://prettier.io/lib/standalone.js:15:106002
at Array.forEach (<anonymous>)
at Object.ensureAllCommentsPrinted (https://prettier.io/lib/standalone.js:15:105970)
at Xi (https://prettier.io/lib/standalone.js:15:111682)
at Yi (https://prettier.io/lib/standalone.js:15:113795)
at formatWithCursor (https://prettier.io/lib/standalone.js:15:113915)
at https://prettier.io/lib/standalone.js:15:386874
at Object.format (https://prettier.io/lib/standalone.js:15:386957)
at formatCode (https://prettier.io/worker.js:115:21)
at handleMessage (https://prettier.io/worker.js:66:18)
from: #9324 (comment)
Prettier 2.1.2
Playground link
Input:
Output:
Expected behavior:
Additional info:
With
typescriptparser, #9324 happens.Playground link