-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
A comment on after parameter list moves before parameter list #9367
Copy link
Copy link
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentslang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)
Description
from: #9324 (comment)
Prettier 2.1.2
Playground link
--parser babel-tsInput:
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.
--parser typescript// 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)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentslang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)Issues affecting TypeScript-specific constructs (not general JS issues)