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

@ -901,14 +901,14 @@ function logical12b(y: number): number {
*/
function logical13(x: number): Array<{ x: string }> {
return [
{ x: x && \"bar\" },
{ x: true && \"bar\" },
{ x: true && false },
{ x: false && false },
{ x: 1 && \"bar\" },
{ x: \"foo\" && \"bar\" },
{ x: \"foo\" && \"bar\" },
{ x: \"foo\" && \"bar\" }
{ x: x && \"bar\" },
{ x: true && \"bar\" },
{ x: true && false },
{ x: false && false },
{ x: 1 && \"bar\" },
{ x: \"foo\" && \"bar\" },
{ x: \"foo\" && \"bar\" },
{ x: \"foo\" && \"bar\" }
];
}
@ -917,14 +917,14 @@ function logical13(x: number): Array<{ x: string }> {
*/
function logical14(x: number): Array<{ x: string }> {
return [
{ x: x || \"bar\" },
{ x: false || \"bar\" },
{ x: false || true },
{ x: true || false },
{ x: 0 || \"bar\" },
{ x: \"foo\" || \"bar\" },
{ x: \"foo\" || \"bar\" },
{ x: \"foo\" || \"bar\" }
{ x: x || \"bar\" },
{ x: false || \"bar\" },
{ x: false || true },
{ x: true || false },
{ x: 0 || \"bar\" },
{ x: \"foo\" || \"bar\" },
{ x: \"foo\" || \"bar\" },
{ x: \"foo\" || \"bar\" }
];
}

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,
};