Enforce a maximum number of parameters in function definitions
Functions that take numerous parameters can be difficult to read and write because it requires the memorization of what each parameter is, its type, and the order they should appear in. As a result, many coders adhere to a convention that caps the number of parameters a function can take.
This rule enforces a maximum number of parameters allowed in function definitions.
This rule has a number or object option:
"max"
(default 3
) enforces a maximum number of parameters in function definitionsDeprecated: The object property maximum
is deprecated; please use the object property max
instead.
Examples of incorrect code for this rule with the default { "max": 3 }
option:
Examples of correct code for this rule with the default { "max": 3 }
option:
This rule was introduced in ESLint v0.0.9.
© OpenJS Foundation and other contributors
Licensed under the MIT License.
https://eslint.org/docs/latest/rules/max-params