]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/no-shadow.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / no-shadow.js
index 3af9354ebd7de1dd4afaa93024431b5e97b28136..3e4d99822a80a77d20f91ff3fcee0c01a87c46a1 100644 (file)
@@ -32,7 +32,7 @@ module.exports = {
         docs: {
             description: "Disallow variable declarations from shadowing variables declared in the outer scope",
             recommended: false,
-            url: "https://eslint.org/docs/rules/no-shadow"
+            url: "https://eslint.org/docs/latest/rules/no-shadow"
         },
 
         schema: [
@@ -67,6 +67,7 @@ module.exports = {
             allow: (context.options[0] && context.options[0].allow) || [],
             ignoreOnInitialization: context.options[0] && context.options[0].ignoreOnInitialization
         };
+        const sourceCode = context.sourceCode;
 
         /**
          * Checks whether or not a given location is inside of the range of a given node.
@@ -318,8 +319,8 @@ module.exports = {
         }
 
         return {
-            "Program:exit"() {
-                const globalScope = context.getScope();
+            "Program:exit"(node) {
+                const globalScope = sourceCode.getScope(node);
                 const stack = globalScope.childScopes.slice();
 
                 while (stack.length) {