Use group instead of conditionalGroup

master
James Long 2017-01-12 14:53:12 -05:00
parent 1549936e68
commit aab300844f
4 changed files with 25 additions and 47 deletions

View File

@ -1866,25 +1866,19 @@ function printExportDeclaration(path, options, print) {
} else {
parts.push(
decl.exportKind === "type" ? "type " : "",
conditionalGroup([
concat([
shouldPrintSpaces ? "{ " : "{",
join(", ", path.map(print, "specifiers")),
shouldPrintSpaces ? " }" : "}"
]),
concat([
"{",
indent(
options.tabWidth,
concat([
hardline,
join(concat([",", hardline]), path.map(print, "specifiers"))
])
),
hardline,
"}"
])
])
group(concat([
"{",
indent(
options.tabWidth,
concat([
options.bracketSpacing ? line : softline,
join(concat([",", options.bracketSpacing ? line : softline]),
path.map(print, "specifiers"))
])
),
options.bracketSpacing ? line : softline,
"}"
]))
);
}

View File

@ -352,15 +352,11 @@ declare export {
* @flow
*/
<<<<<<< bbe2524dab164d43febc1a8d549a76e26eb9d483
declare export { numberValue1, numberValue2 as numberValue2_renamed } from \"ES6_ExportFrom_Source1\";
"
=======
declare export {
numberValue1,
numberValue2 as numberValue2_renamed
} from \"ES6_ExportFrom_Source1\";"
>>>>>>> Break long `exports` into multiple lines.
} from \"ES6_ExportFrom_Source1\";
"
`;
exports[`test ES6_ExportFrom_Intermediary2.js 1`] = `
@ -379,15 +375,11 @@ declare export {
* @flow
*/
<<<<<<< bbe2524dab164d43febc1a8d549a76e26eb9d483
declare export { numberValue1, numberValue2 as numberValue2_renamed2 } from \"ES6_ExportFrom_Source2\";
"
=======
declare export {
numberValue1,
numberValue2 as numberValue2_renamed2
} from \"ES6_ExportFrom_Source2\";"
>>>>>>> Break long `exports` into multiple lines.
} from \"ES6_ExportFrom_Source2\";
"
`;
exports[`test ES6_ExportFrom_Source1.js 1`] = `

View File

@ -429,15 +429,11 @@ export {
* @flow
*/
<<<<<<< bbe2524dab164d43febc1a8d549a76e26eb9d483
export { numberValue1, numberValue2 as numberValue2_renamed } from \"ES6_ExportFrom_Source1\";
"
=======
export {
numberValue1,
numberValue2 as numberValue2_renamed
} from \"ES6_ExportFrom_Source1\";"
>>>>>>> Break long `exports` into multiple lines.
} from \"ES6_ExportFrom_Source1\";
"
`;
exports[`test ES6_ExportFrom_Intermediary2.js 1`] = `
@ -456,15 +452,11 @@ export {
* @flow
*/
<<<<<<< bbe2524dab164d43febc1a8d549a76e26eb9d483
export { numberValue1, numberValue2 as numberValue2_renamed2 } from \"ES6_ExportFrom_Source2\";
"
=======
export {
numberValue1,
numberValue2 as numberValue2_renamed2
} from \"ES6_ExportFrom_Source2\";"
>>>>>>> Break long `exports` into multiple lines.
} from \"ES6_ExportFrom_Source2\";
"
`;
exports[`test ES6_ExportFrom_Source1.js 1`] = `

View File

@ -1,4 +1,3 @@
<<<<<<< bbe2524dab164d43febc1a8d549a76e26eb9d483
exports[`test directives.js 1`] = `
"\"use strict\";
@ -12,7 +11,8 @@ function fn() {
\"use strict\";
}
"
=======
`;
exports[`test exports.js 1`] = `
"export { value1, value2 as value2_renamed, value3, value4 as value4_renamed, value5 } from \"exports\";
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -22,8 +22,8 @@ export {
value3,
value4 as value4_renamed,
value5
} from \"exports\";"
>>>>>>> Break long `exports` into multiple lines.
} from \"exports\";
"
`;
exports[`test optional-type-name.js 1`] = `