docs: {
description: "Disallow the use of `undefined` as an identifier",
recommended: false,
- url: "https://eslint.org/docs/rules/no-undefined"
+ url: "https://eslint.org/docs/latest/rules/no-undefined"
},
schema: [],
create(context) {
+ const sourceCode = context.sourceCode;
+
/**
* Report an invalid "undefined" identifier node.
* @param {ASTNode} node The node to report.
}
return {
- "Program:exit"() {
- const globalScope = context.getScope();
+ "Program:exit"(node) {
+ const globalScope = sourceCode.getScope(node);
const stack = [globalScope];