eslint-plugin-promise icon indicating copy to clipboard operation
eslint-plugin-promise copied to clipboard

Rule to require that Promise executor function calls resolve

Open jroru opened this issue 2 years ago • 0 comments
trafficstars

Description

A rule could be created for the Promise constructor executor function to require that the resolve callback is called.

Example of incorrect code for this rule:

await new Promise(() => {
  setTimeout(() => {}, 2000);
});

Example of correct code for this rule:

await new Promise((resolve) => {
  setTimeout(resolve, 2000);
});

jroru avatar Apr 22 '23 00:04 jroru