]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/no-undefined.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / no-undefined.js
index e006320b5223696bd0c206423748d357b12ecca6..8f47ca1b020a49cb4824365fbad2f9badc83d89a 100644 (file)
@@ -16,7 +16,7 @@ module.exports = {
         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: [],
@@ -28,6 +28,8 @@ module.exports = {
 
     create(context) {
 
+        const sourceCode = context.sourceCode;
+
         /**
          * Report an invalid "undefined" identifier node.
          * @param {ASTNode} node The node to report.
@@ -66,8 +68,8 @@ module.exports = {
         }
 
         return {
-            "Program:exit"() {
-                const globalScope = context.getScope();
+            "Program:exit"(node) {
+                const globalScope = sourceCode.getScope(node);
 
                 const stack = [globalScope];