Fix space missing before , on import with bracket spacing off (#279)

Same fix as #278. We use the same (wrong) pattern in both places
This commit is contained in:
Christopher Chedeau authored and James Long committed 2017-01-17 17:12:56 -05:00
1 parent b580a18f30
commit 92795a0fda
4 files changed
+68 -2

No files matched your search

+2 -2
View File
@@ -454,7 +454,7 @@ function genericPrintNoParens(path, options, print) {
if (grouped.length > 0) {
parts.push(
group(
multilineGroup(
concat([
"{",
indent(
@@ -462,7 +462,7 @@ function genericPrintNoParens(path, options, print) {
concat([
options.bracketSpacing ? line : softline,
join(
concat([ ",", options.bracketSpacing ? line : softline ]),
concat([ ",", line ]),
grouped
)
])
@@ -0,0 +1,53 @@
exports[`test brackets.js 1`] = `
"import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from \'.\';
import {fitsIn, oneLine} from \'.\';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from \".\";
import { fitsIn, oneLine } from \".\";
"
`;
exports[`test brackets.js 2`] = `
"import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from \'.\';
import {fitsIn, oneLine} from \'.\';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from \".\";
import { fitsIn, oneLine } from \".\";
"
`;
+11
View File
@@ -0,0 +1,11 @@
import {
runTaskForChanged,
description,
someOtherLabel,
thatMakes,
itGo,
multiLine,
andMore,
soWeCanGetItTo80Columns
} from '.';
import {fitsIn, oneLine} from '.';
+2
View File
@@ -0,0 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {bracketsSpacing: false});