]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/no-label-var.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / no-label-var.js
index a07d283f522b5ed33ca13b409893397df16ec396..bf33cd157bade13c1c3550213b204567b48b1bf2 100644 (file)
@@ -23,7 +23,7 @@ module.exports = {
         docs: {
             description: "Disallow labels that share a name with a variable",
             recommended: false,
-            url: "https://eslint.org/docs/rules/no-label-var"
+            url: "https://eslint.org/docs/latest/rules/no-label-var"
         },
 
         schema: [],
@@ -34,6 +34,7 @@ module.exports = {
     },
 
     create(context) {
+        const sourceCode = context.sourceCode;
 
         //--------------------------------------------------------------------------
         // Helpers
@@ -59,7 +60,7 @@ module.exports = {
             LabeledStatement(node) {
 
                 // Fetch the innermost scope.
-                const scope = context.getScope();
+                const scope = sourceCode.getScope(node);
 
                 /*
                  * Recursively find the identifier walking up the scope, starting