We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
globalScope
1 parent 18c7f67 commit ae58facCopy full SHA for ae58fac
apps/oxlint/src-js/plugins/scope.ts
@@ -165,8 +165,11 @@ export function isGlobalReference(node: ESTree.Node): boolean {
165
return false;
166
}
167
168
+ const globalScope = SOURCE_CODE.scopeManager.scopes[0];
169
+ if (!globalScope) return false;
170
+
171
// If the identifier is a reference to a global variable, the global scope should have a variable with the name.
- const variable = SOURCE_CODE.scopeManager.globalScope.set.get(name);
172
+ const variable = globalScope.set.get(name);
173
174
// Global variables are not defined by any node, so they should have no definitions.
175
if (!variable || variable.defs.length > 0) {
0 commit comments