Skip to content

Commit

Permalink
Declare class in namespace should be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
yimingjfe committed Jul 20, 2022
1 parent b807206 commit 799c0c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/babel-plugin-transform-typescript/src/namespace.ts
Expand Up @@ -185,6 +185,10 @@ function handleNested(
case "TSEnumDeclaration":
case "FunctionDeclaration":
case "ClassDeclaration": {
if (subNode.declaration.declare) {
continue;
}

const itemName = subNode.declaration.id.name;
names.add(itemName);
namespaceTopLevel.splice(
Expand Down
@@ -0,0 +1,4 @@
export namespace A {
export declare class B {
}
}
@@ -0,0 +1,3 @@
export let A;

(function (_A) {})(A || (A = {}));

0 comments on commit 799c0c1

Please sign in to comment.