Prettier 1.19.1
Playground link
Input:
f(
// comment
(0 /*: number */)
);
Output:
ensureAllCommentsPrinted/<@https://prettier.io/lib/standalone.js:15543:15
ensureAllCommentsPrinted@https://prettier.io/lib/standalone.js:15541:17
coreFormat@https://prettier.io/lib/standalone.js:15592:29
format@https://prettier.io/lib/standalone.js:15832:75
formatWithCursor@https://prettier.io/lib/standalone.js:15848:14
withPlugins/<@https://prettier.io/lib/standalone.js:31794:17
format@https://prettier.io/lib/standalone.js:31802:14
formatCode@https://prettier.io/worker.js:234:21
handleMessage@https://prettier.io/worker.js:185:18
self.onmessage@https://prettier.io/worker.js:155:14
Expected behavior:
Prettier exits successfully. Prettier does not change the formatting of this code.
Observations:
The following changes to the input make the crash disappear:
- Remove the : in the comment on line 3
- Remove the ( and ) on line 3
- Remove the comment on line 2
Prettier 1.19.1
Playground link
Input:
Output:
Expected behavior:
Prettier exits successfully. Prettier does not change the formatting of this code.
Observations:
The following changes to the input make the crash disappear: