src/language-js/printer-estree.js/printExportDeclaration
function printExportDeclaration(path, options, print) {
  const decl = path.getValue();
  const semi = options.semi ? ";" : "";
  const parts = ["export "];

  const isDefault = decl.default || decl.type === "ExportDefaultDeclaration";

  if (isDefault) {
    parts.push("default ");
  }

  parts.push(
    comments.printDanglingComments(path, options, /* sameIndent */ true)
  );

  if (needsHardlineAfterDanglingComment(decl)) {
    parts.push(hardline);
  }

  if (decl.declaration) {
    parts.push(path.call(print, "declaration"));

    if (
      isDefault &&
      decl.declaration.type !== "ClassDeclaration" &&
      decl.declaration.type !== "FunctionDeclaration" &&
      decl.declaration.type !== "TSInterfaceDeclaration" &&
      decl.declaration.type !== "DeclareClass" &&
      decl.declaration.type !== "DeclareFunction" &&
      decl.declaration.type !== "TSDeclareFunction"
    ) {
      parts.push(semi);
    }
  } else {
    parts.push(decl.exportKind === "type" ? "type " : "");
    parts.push(printModuleSpecifiers(path, options, print));
    parts.push(printModuleSource(path, options, print));
    parts.push(semi);
  }

  return concat(parts);
}