You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This rule forbids usage of Promise-like values in statements without handling their errors appropriately. Unhandled promises can cause several issues, such as improperly sequenced operations, ignored Promise rejections and more. Valid ways of handling a Promise-valued statement include awaiting, returning, and either calling .then() with two arguments or .catch() with one argument
It is very useful especially when writing tests which including async functions.
For example, this test will pass even when it does not include the text("Some Text") because this sentence returns a unhandled promise.
// Should put `await` head
expect(waitForText("Some Text")).resolves.toBeTruthy();
WHY & WHAT
We can now use the
no-floating-promises
typescript-eslint/typescript-eslint#495
How do you think about this?
@KentoMoriwaki @chloe463 @kobayang
The text was updated successfully, but these errors were encountered: