no-new-statics
Configuration
rslint.config.ts
Disallow calling new on a Promise static method.
Rule Details
Promise static methods (resolve, reject, all, allSettled, any, race, withResolvers) return Promises directly — they are not constructors. Calling new on them is almost always a mistake and produces unexpected behavior.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Autofix
This rule provides an autofix that removes the new keyword.
Differences from ESLint
new (Promise as any).resolve()and similar TS type-assertion or non-null-assertion wrappers aroundPromiseare not flagged. Under@typescript-eslint/parser, type wrappers are stripped before the rule sees the AST, so ESLint would flag these. rslint preserves the TS node structure and only unwraps parentheses.