]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/lib/rules/prefer-rest-params.js
import 8.41.0 source
[pve-eslint.git] / eslint / lib / rules / prefer-rest-params.js
index 14b9ae55a4b8bc4dc50a482b9a5939ebc8e79073..b7e35b40a725cfc4b4c6d4f90abd41c2273b946d 100644 (file)
@@ -67,7 +67,7 @@ module.exports = {
         docs: {
             description: "Require rest parameters instead of `arguments`",
             recommended: false,
-            url: "https://eslint.org/docs/rules/prefer-rest-params"
+            url: "https://eslint.org/docs/latest/rules/prefer-rest-params"
         },
 
         schema: [],
@@ -79,6 +79,8 @@ module.exports = {
 
     create(context) {
 
+        const sourceCode = context.sourceCode;
+
         /**
          * Reports a given reference.
          * @param {eslint-scope.Reference} reference A reference to report.
@@ -94,10 +96,11 @@ module.exports = {
 
         /**
          * Reports references of the implicit `arguments` variable if exist.
+         * @param {ASTNode} node The node representing the function.
          * @returns {void}
          */
-        function checkForArguments() {
-            const argumentsVar = getVariableOfArguments(context.getScope());
+        function checkForArguments(node) {
+            const argumentsVar = getVariableOfArguments(sourceCode.getScope(node));
 
             if (argumentsVar) {
                 argumentsVar