Never print blank lines with spaces
parent
a9d06355ee
commit
5efa13a10c
|
@ -239,6 +239,11 @@ function print(w, doc) {
|
|||
}
|
||||
// fallthrough
|
||||
case MODE_BREAK:
|
||||
const lastString = out[out.length - 1];
|
||||
if(lastString.match(/^\s*\n\s*$/)) {
|
||||
out[out.length - 1] = "\n";
|
||||
}
|
||||
|
||||
if(doc.literal) {
|
||||
out.push("\n");
|
||||
pos = 0;
|
||||
|
|
|
@ -1680,7 +1680,7 @@ function printStatementSequence(path, options, print) {
|
|||
parts.push(stmtPrinted);
|
||||
|
||||
if (addSpacing && !isLastStatement(stmtPath)) {
|
||||
parts.push(literalline);
|
||||
parts.push(hardline);
|
||||
}
|
||||
|
||||
printed.push(concat(parts));
|
||||
|
|
Loading…
Reference in New Issue