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: [],
create(context) {
+ const sourceCode = context.sourceCode;
+
/**
* Reports a given reference.
* @param {eslint-scope.Reference} reference A reference to report.
/**
* 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