]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/no-undef-init.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / no-undef-init.js
index 2cb1c3f3710169ae1190f397de4d73c9a5309846..be19d6f9526bd8b89270f8e1fa9c027e50a4b9f7 100644 (file)
@@ -19,7 +19,7 @@ module.exports = {
         docs: {
             description: "Disallow initializing variables to `undefined`",
             recommended: false,
-            url: "https://eslint.org/docs/rules/no-undef-init"
+            url: "https://eslint.org/docs/latest/rules/no-undef-init"
         },
 
         schema: [],
@@ -32,14 +32,14 @@ module.exports = {
 
     create(context) {
 
-        const sourceCode = context.getSourceCode();
+        const sourceCode = context.sourceCode;
 
         return {
 
             VariableDeclarator(node) {
                 const name = sourceCode.getText(node.id),
                     init = node.init && node.init.name,
-                    scope = context.getScope(),
+                    scope = sourceCode.getScope(node),
                     undefinedVar = astUtils.getVariableByName(scope, "undefined"),
                     shadowed = undefinedVar && undefinedVar.defs.length > 0,
                     lastToken = sourceCode.getLastToken(node);