Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 866 Bytes

File metadata and controls

36 lines (23 loc) · 866 Bytes

promise/no-new-statics

🛠️ An auto-fix is available for this rule.

What it does

Disallows calling new on static Promise methods.

Why is this bad?

Calling a static Promise method with new is invalid and will result in a TypeError at runtime.

Examples

Examples of incorrect code for this rule:

const x = new Promise.resolve(value);

Examples of correct code for this rule:

const x = Promise.resolve(value);

References