Skip to content

Commit

Permalink
fix: add missing type check to no-unused-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Feb 21, 2021
1 parent fe74a6f commit 1121cd7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/eslint-plugin/src/rules/no-unused-vars.ts
Expand Up @@ -408,10 +408,12 @@ export default util.createRule<Options, MessageIds>({
return cached;
}

for (const statement of node.body?.body ?? []) {
if (statement.type === AST_NODE_TYPES.TSExportAssignment) {
MODULE_DECL_CACHE.set(node, true);
return true;
if (node.body && node.body.type !== AST_NODE_TYPES.TSModuleDeclaration) {
for (const statement of node.body.body ?? []) {
if (statement.type === AST_NODE_TYPES.TSExportAssignment) {
MODULE_DECL_CACHE.set(node, true);
return true;
}
}
}

Expand Down

0 comments on commit 1121cd7

Please sign in to comment.