Add missing explanatory comment in ForStatement case (#748)
* Add missing explanatory comment in ForStatement case :notepad-spiral:.
* Update comment 🚀.
master
parent
77f6f4de68
commit
de8873ab23
|
@ -989,6 +989,9 @@ function genericPrintNoParens(path, options, print) {
|
|||
case "ForStatement": {
|
||||
const body = adjustClause(path.call(print, "body"), options);
|
||||
|
||||
// We want to keep dangling comments above the loop to stay consistent.
|
||||
// Any comment positioned between the for statement and the parentheses
|
||||
// is going to be printed before the statement.
|
||||
const dangling = comments.printDanglingComments(path, options, /* sameLine */ true);
|
||||
const printedComments = dangling ? concat([dangling, softline]) : "";
|
||||
|
||||
|
|
Loading…
Reference in New Issue