# valid-params

Rule `promise/valid-params`. Enforces the proper number of arguments are passed to Promise functions.

- Source: promise
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 9.9M weekly downloads of presets that enable it
- Trend: +30.4% last quarter
- Rank: #1116 by reach, #1134 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `promise/valid-params` | yes | no | package `eslint-plugin-promise` | [docs](https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/valid-params.md) |
| Oxlint | `promise/valid-params` | no | no | plugin `promise`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/promise/valid-params.html) |

## Code examples

### Correct: the rule accepts this

```js
// Promise.all() requires 1 argument
Promise.all([p1, p2, p3])
Promise.all(iterable)

// Promise.race() requires 1 argument
Promise.race([p1, p2, p3])
Promise.race(iterable)

// Promise.resolve() requires 0 or 1 arguments
Promise.resolve()
Promise.resolve({})
Promise.resolve([1, 2, 3])
Promise.resolve(referenceToObject)

// Promise.reject() requires 0 or 1 arguments
Promise.reject()
Promise.reject(Error())
Promise.reject(referenceToError)

// Promise.then() requires 1 or 2 arguments
somePromise().then((value) => doSomething(value))
somePromise().then(successCallback, errorCallback)

// Promise.catch() requires 1 argument
somePromise().catch((error) => {
  handleError(error)
})
somePromise().catch(console.error)

// Promise.finally() requires 1 argument
somePromise().finally(() => {
  console.log('done!')
// …
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import promise from "eslint-plugin-promise";

export default [
  {
    plugins: { promise },
    rules: {
      "promise/valid-params": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "promise"
  ],
  "rules": {
    "promise/valid-params": "error"
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Promise recommended](https://lintradar.dev/presets/promise-recommended.md) | ESLint | `eslint-plugin-promise` | 10 | 7.8M | +15.7% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |

## Related rules

- [promise/no-promise-in-callback](https://lintradar.dev/rules/promise/no-promise-in-callback.md): Disallow using promises inside of callbacks.
- [promise/no-new-statics](https://lintradar.dev/rules/promise/no-new-statics.md): Disallow calling `new` on a Promise static method.
- [promise/no-callback-in-promise](https://lintradar.dev/rules/promise/no-callback-in-promise.md): Disallow calling `cb()` inside of a `then()` (use [util.callbackify][] instead).
- [promise/catch-or-return](https://lintradar.dev/rules/promise/catch-or-return.md): Enforce the use of `catch()` on un-returned promises.
- [promise/always-return](https://lintradar.dev/rules/promise/always-return.md): Require returning inside each `then()` to create readable and reusable Promise chains.
- [promise/no-nesting](https://lintradar.dev/rules/promise/no-nesting.md): Disallow nested `then()` or `catch()` statements.

---

Web page: https://lintradar.dev/rules/promise/valid-params. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
