valid-params
Configuration
rslint.config.ts
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()andPromise.reject()require 0 or 1 arguments.Promise.all(),Promise.race(),Promise.allSettled(), andPromise.any()require 1 argument..then()requires 1 or 2 arguments..catch()and.finally()require 1 argument.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
exclude
An array of method names to skip. For example, projects using Bluebird-style filtered catches can exclude catch:
Differences from ESLint
None known.