promise/param-names
eslint-plugin-promise
No autofixRecommended
eslint.config.js
import promise from "eslint-plugin-promise";
export default [
{
plugins: { promise },
rules: {
"promise/param-names": "error",
},
},
];Enforce consistent param names and ordering when creating new promises.
new Promise(function (reject, resolve) { ... }) // incorrect order
new Promise(function (ok, fail) { ... }) // non-standard parameter names
new Promise(function (_, reject) { ... }) // a simple underscore is not allowednew Promise(function (resolve) { ... })
new Promise(function (resolve, reject) { ... })
new Promise(function (_resolve, _reject) { ... }) // Unused marker for parameters are allowedExamples from the ESLint documentation.
promise/param-names
eslint-plugin-promise
import promise from "eslint-plugin-promise";
export default [
{
plugins: { promise },
rules: {
"promise/param-names": "error",
},
},
];promise/param-names
promise plugin · style
{
"plugins": [
"promise"
],
"rules": {
"promise/param-names": "error"
}
}Biome does not have this rule.
Disallow wrapping values in Promise.resolve or Promise.reject when not needed.
Disallow return statements in finally().
Disallow nested then() or catch() statements.
Require returning inside each then() to create readable and reusable Promise chains.
Enforce the use of catch() on un-returned promises.
Disallow calling cb() inside of a then() (use [util.callbackify][] instead).