> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# valid-params

[Added in v0.6.3](https://github.com/web-infra-dev/rslint/releases/tag/v0.6.3)
## Configuration

| Preset                              | Configured Value |
| ----------------------------------- | ---------------- |
| ✅ promisePlugin.configs.recommended | `"warn"`         |


```ts title=rslint.config.ts
import { defineConfig, promisePlugin } from '@rslint/core';

export default defineConfig([
  promisePlugin.configs.recommended,
  {
    rules: {
      'promise/valid-params': 'error',
    },
  },
]);
```

Enforce the proper number of arguments passed to Promise functions (`promise/valid-params`).

Calling a Promise function with the incorrect number of arguments can lead to unexpected behavior or hard to spot bugs.

## Rule Details

This rule reports calls to Promise functions with an invalid number of arguments:

- `Promise.resolve()` and `Promise.reject()` require 0 or 1 arguments.
- `Promise.all()`, `Promise.race()`, `Promise.allSettled()`, and `Promise.any()` require 1 argument.
- `.then()` requires 1 or 2 arguments.
- `.catch()` and `.finally()` require 1 argument.

Examples of incorrect code for this rule:

```js
Promise.all()
Promise.race(a, b)
Promise.resolve(a, b)
Promise.reject(error, extra)
promise.then()
promise.then(a, b, c)
promise.catch()
promise.finally(a, b)
```

Examples of correct code for this rule:

```js
Promise.all([p1, p2])
Promise.race(iterable)
Promise.resolve(value)
Promise.reject(error)
promise.then(onFulfilled)
promise.then(onFulfilled, onRejected)
promise.catch(onRejected)
promise.finally(onFinally)
```

## Options

### `exclude`

An array of method names to skip. For example, projects using Bluebird-style filtered catches can exclude `catch`:

```js
{
  "promise/valid-params": ["warn", { "exclude": ["catch"] }]
}
```

## Differences from ESLint

None known.

## Original Documentation

- [eslint-plugin-promise: valid-params](https://github.com/eslint-community/eslint-plugin-promise/blob/v7.3.0/docs/rules/valid-params.md)
- [Source code](https://github.com/eslint-community/eslint-plugin-promise/blob/v7.3.0/rules/valid-params.js)
