Skip to content

Commit

Permalink
Fix tscheck
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed May 17, 2023
1 parent 3017634 commit 893442d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions packages/babel-parser/src/plugins/placeholders.ts
Expand Up @@ -302,12 +302,25 @@ export default (superClass: typeof Parser) =>
return super.isExportDefaultSpecifier();
}

maybeParseExportDefaultSpecifier(node: N.Node): boolean {
if (node.specifiers && node.specifiers.length > 0) {
maybeParseExportDefaultSpecifier(
node: Undone<
| N.ExportDefaultDeclaration
| N.ExportAllDeclaration
| N.ExportNamedDeclaration
>,
maybeDefaultIdentifier: N.Identifier | null,
): node is Undone<N.ExportNamedDeclaration> {
if (
(node as N.ExportNamedDeclaration).specifiers &&
(node as N.ExportNamedDeclaration).specifiers.length > 0
) {
// "export %%NAME%%" has already been parsed by #parseExport.
return true;
}
return super.maybeParseExportDefaultSpecifier(node);
return super.maybeParseExportDefaultSpecifier(
node,
maybeDefaultIdentifier,
);
}

checkExport(node: N.ExportNamedDeclaration): void {
Expand Down

0 comments on commit 893442d

Please sign in to comment.