]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/no-const-assign.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / no-const-assign.js
index 55e40c8849f05356603199a0975b0702837fc98f..0ceaf7ea5ed4e33b71fee4ee846b1e74513b440f 100644 (file)
@@ -19,7 +19,7 @@ module.exports = {
         docs: {
             description: "Disallow reassigning `const` variables",
             recommended: true,
-            url: "https://eslint.org/docs/rules/no-const-assign"
+            url: "https://eslint.org/docs/latest/rules/no-const-assign"
         },
 
         schema: [],
@@ -31,6 +31,8 @@ module.exports = {
 
     create(context) {
 
+        const sourceCode = context.sourceCode;
+
         /**
          * Finds and reports references that are non initializer and writable.
          * @param {Variable} variable A variable to check.
@@ -45,7 +47,7 @@ module.exports = {
         return {
             VariableDeclaration(node) {
                 if (node.kind === "const") {
-                    context.getDeclaredVariables(node).forEach(checkVariable);
+                    sourceCode.getDeclaredVariables(node).forEach(checkVariable);
                 }
             }
         };