-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentsarea:no-semilang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 2.8.1
Playground link
--parser acorn
--no-semiInput:
'use strict';
/* comment */
[].forEach();Output:
"use strict"
/* comment */
;[].forEach()Second Output:
Error: Comment "comment" was not printed. Please report this error!
at Object.N [as ensureAllCommentsPrinted] (https://prettier.io/lib/standalone.js:41:7554)
at A (https://prettier.io/lib/standalone.js:41:15193)
at x (https://prettier.io/lib/standalone.js:45:576)
at Object.formatWithCursor (https://prettier.io/lib/standalone.js:116:7283)
at formatCode (https://prettier.io/worker.js:173:21)
at handleFormatMessage (https://prettier.io/worker.js:161:34)
at handleMessage (https://prettier.io/worker.js:77:14)
at self.onmessage (https://prettier.io/worker.js:53:14)Expected behavior:
Should be able to print
Reproduce in semi mode
Prettier 2.8.1
Playground link
--parser acornInput:
'use strict' /* comment */;Output:
Error: Comment "comment" was not printed. Please report this error!
at Object.N [as ensureAllCommentsPrinted] (https://prettier.io/lib/standalone.js:41:7554)
at A (https://prettier.io/lib/standalone.js:41:15193)
at x (https://prettier.io/lib/standalone.js:45:576)
at Object.formatWithCursor (https://prettier.io/lib/standalone.js:116:7283)
at formatCode (https://prettier.io/worker.js:173:21)
at handleFormatMessage (https://prettier.io/worker.js:104:24)
at handleMessage (https://prettier.io/worker.js:77:14)
at self.onmessage (https://prettier.io/worker.js:53:14)Metadata
Metadata
Assignees
Labels
area:commentsIssues with how Prettier prints commentsIssues with how Prettier prints commentsarea:no-semilang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.