Never print blank lines with spaces

This commit is contained in:
James Long committed 2016-12-31 14:38:33 -05:00
1 parent a9d06355ee
commit 5efa13a10c
2 files changed
+6 -1

No files matched your search

+5
View File
@@ -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;
+1 -1
View File
@@ -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));