Fix spurious whitespace (#463)

This was introduced by #314 where `line` should have been `softline`. By the way, I was going to propose renaming `line` to `line_or_space` and `softline` to `line_or_nothing` which should make it more explicit what is going on.

Fixes #461
master
Christopher Chedeau 2017-01-25 13:24:16 -08:00 committed by James Long
parent d08c006902
commit b4f1649d1a
4 changed files with 42 additions and 17 deletions

View File

@ -627,7 +627,7 @@ function genericPrintNoParens(path, options, print) {
indent(options.tabWidth, concat([softline, printedValue]))
])
),
line,
softline,
ifBreak(")")
])
);

View File

@ -77,6 +77,11 @@ const aLong = {
},
dHasALongName: \'a-long-value-too\'
};
const aLong = {
dHasALongName: \'a-long-value-too\',
eHasABooleanExpression: a === a,
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = { b: true, c: { c1: \"hello\" }, d: false };
@ -88,6 +93,11 @@ const aLong = {
},
dHasALongName: \"a-long-value-too\"
};
const aLong = {
dHasALongName: \"a-long-value-too\",
eHasABooleanExpression: a === a
};
"
`;
@ -108,6 +118,11 @@ const aLong = {
},
dHasALongName: \'a-long-value-too\'
};
const aLong = {
dHasALongName: \'a-long-value-too\',
eHasABooleanExpression: a === a,
};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const a = { b: true, c: { c1: \"hello\" }, d: false };
@ -119,5 +134,10 @@ const aLong = {
},
dHasALongName: \"a-long-value-too\",
};
const aLong = {
dHasALongName: \"a-long-value-too\",
eHasABooleanExpression: a === a,
};
"
`;

View File

@ -14,3 +14,8 @@ const aLong = {
},
dHasALongName: 'a-long-value-too'
};
const aLong = {
dHasALongName: 'a-long-value-too',
eHasABooleanExpression: a === a,
};