Skip to content

Commit

Permalink
Fix: typescript declare global conflict with TSModuleBlock declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
The-x-Theorist committed Jan 6, 2022
1 parent 94af0e5 commit a0bd18e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
@@ -0,0 +1,3 @@
declare global { namespace globalThis { var i18n: any; } }

export class i18n {}
@@ -0,0 +1 @@
export class i18n {}
3 changes: 3 additions & 0 deletions packages/babel-traverse/src/scope/index.ts
Expand Up @@ -745,6 +745,9 @@ export default class Scope {
path: NodePath,
bindingPath: NodePath = path,
) {
if (path.isVariableDeclarator() && path.scope.path.isTSModuleBlock()) {
return;
}
if (!kind) throw new ReferenceError("no `kind`");

if (path.isVariableDeclaration()) {
Expand Down

0 comments on commit a0bd18e

Please sign in to comment.