Skip to content

Commit

Permalink
[Fix] no-import-module-exports: avoid a crash in eslint < 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 10, 2021
1 parent 790d9af commit dfc5b54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules/no-import-module-exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ function getEntryPoint(context) {
}

function findScope(context, identifier) {
const scopeManager = context.getSourceCode().scopeManager;
const { scopeManager } = context.getSourceCode();

return scopeManager.scopes.slice().reverse().find((scope) => scope.variables.some(variable => variable.identifiers.some((node) => node.name === identifier)));
return scopeManager && scopeManager.scopes.slice().reverse().find((scope) => scope.variables.some(variable => variable.identifiers.some((node) => node.name === identifier)));
}

module.exports = {
Expand Down

0 comments on commit dfc5b54

Please sign in to comment.