Skip to content

eslint/max-params Style

What it does

Enforce a maximum number of parameters in function definitions

Why is this bad?

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.

Example

javascript
function foo(bar, baz, qux, qxx) {
  doSomething();
}

How to use

To enable this rule in the CLI or using the config file, you can use:

bash
oxlint --deny max-params
json
{
  "rules": {
    "max-params": "error"
  }
}

References

Released under the MIT License.