promise/no-new-statics
eslint-plugin-promise
Safe autofixRecommended
eslint.config.js
import promise from "eslint-plugin-promise";
export default [
{
plugins: { promise },
rules: {
"promise/no-new-statics": "error",
},
},
];new Promise.resolve(value)
new Promise.reject(error)
new Promise.race([p1, p2])
new Promise.all([p1, p2])Promise.resolve(value)
Promise.reject(error)
Promise.race([p1, p2])
Promise.all([p1, p2])Examples from the ESLint documentation.
promise/no-new-statics
eslint-plugin-promise
import promise from "eslint-plugin-promise";
export default [
{
plugins: { promise },
rules: {
"promise/no-new-statics": "error",
},
},
];promise/no-new-statics
promise plugin · correctness
{
"plugins": [
"promise"
],
"rules": {
"promise/no-new-statics": "error"
}
}Biome does not have this rule.
Disallow calling cb() inside of a then() (use [util.callbackify][] instead).
Disallow using promises inside of callbacks.
Enforce the use of catch() on un-returned promises.
Enforces the proper number of arguments are passed to Promise functions.
Require returning inside each then() to create readable and reusable Promise chains.
Disallow nested then() or catch() statements.