Skip to content

Commit dfc5b54

Browse files
committedNov 10, 2021
[Fix] no-import-module-exports: avoid a crash in eslint < 4
1 parent 790d9af commit dfc5b54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/rules/no-import-module-exports.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ function getEntryPoint(context) {
1414
}
1515

1616
function findScope(context, identifier) {
17-
const scopeManager = context.getSourceCode().scopeManager;
17+
const { scopeManager } = context.getSourceCode();
1818

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

2222
module.exports = {

0 commit comments

Comments
 (0)
Please sign in to comment.