Add semicolon to more default exports (#343)

master
Kevin Gibbons 2017-01-19 14:30:36 -08:00 committed by Christopher Chedeau
parent 658998c5b1
commit a8ca2b21f4
3 changed files with 6 additions and 6 deletions

View File

@ -1823,9 +1823,9 @@ function printExportDeclaration(path, options, print) {
if (
decl.type === "ExportDefaultDeclaration" &&
(decl.declaration.type == "Identifier" ||
decl.declaration.type === "CallExpression" ||
typeIsFunction(decl.declaration.type))
(decl.declaration.type !== "ClassDeclaration" &&
decl.declaration.type !== "FunctionDeclaration" &&
decl.declaration.type !== "FunctionExpression")
) {
parts.push(";");
}

View File

@ -324,7 +324,7 @@ export var str = \'asdf\';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* @flow */
export default 42
export default 42;
export var str = \"asdf\";
"
`;
@ -1366,7 +1366,7 @@ exports[`test export_default_function_expression.js 1`] = `
"export default (function() {});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export default function() {
};
}
"
`;

View File

@ -102,7 +102,7 @@ export default 42;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* @flow */
export default 42
export default 42;
"
`;