]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/prefer-destructuring.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / prefer-destructuring.js
index fdf46f65f59b72c6ac0d68387251278d7fa5b8c2..c6075c55bf5ae3b5242d7578707c85c2bf632274 100644 (file)
@@ -28,7 +28,7 @@ module.exports = {
         docs: {
             description: "Require destructuring from arrays and/or objects",
             recommended: false,
-            url: "https://eslint.org/docs/rules/prefer-destructuring"
+            url: "https://eslint.org/docs/latest/rules/prefer-destructuring"
         },
 
         fixable: "code",
@@ -190,7 +190,7 @@ module.exports = {
          */
         function fixIntoObjectDestructuring(fixer, node) {
             const rightNode = node.init;
-            const sourceCode = context.getSourceCode();
+            const sourceCode = context.sourceCode;
 
             // Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved.
             if (sourceCode.getCommentsInside(node).length > sourceCode.getCommentsInside(rightNode.object).length) {