param-names
Configuration
rslint.config.ts
Enforce consistent param names and ordering when creating new promises.
Rule Details
Ensures that new Promise() is instantiated with the parameter names
resolve, reject to avoid confusion with order such as reject, resolve.
The Promise constructor uses the
RevealingConstructor pattern.
Using the same parameter names as the language specification makes code more
uniform and easier to understand.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
resolvePattern
Pass { resolvePattern: "^_?resolve$" } to customize the first argument name
pattern. Default is "^_?resolve$".
rejectPattern
Pass { rejectPattern: "^_?reject$" } to customize the second argument name
pattern. Default is "^_?reject$".