-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Open
Copy link
Labels
lang:javascriptIssues affecting JSIssues affecting JS
Description
Prettier 3.6.2
Playground link
--parser babelInput:
while(true) // Comment
{}
while(true) /* Comment */
{}
while(true)
/* Comment */
{}
for (let a = 0; a < 10; a ++) // Comment
{}
for (let a = 0; a < 10; a ++) /* Comment */
{}
for (let a = 0; a < 10; a ++)
/* Comment */
{}
if(true) // Comment
{}
if(true) /* Comment */
{}
if(true)
/* Comment */
{}Output:
while (true) {
// Comment
}
while (true) {
/* Comment */
}
while (true) {
/* Comment */
}
for (
let a = 0;
a < 10;
a++ // Comment
) {}
for (let a = 0; a < 10; a++ /* Comment */) {}
for (let a = 0; a < 10; a++) /* Comment */
{}
if (true) {
// Comment
}
if (true) {
/* Comment */
}
if (true) {
/* Comment */
}Expected output:
Hard to say what the expected output
Why?
Those are similar kinds of statements, so they should have the same formatting logic
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JS