Pattern: Redundant await
operator usage
Issue: -
The await
operator should only be used with Promise
values. Using it with non-promise values or multiple times on the same promise is unnecessary and can make code harder to read.
Example of incorrect code:
async function bad() {
await await promise;
}
Example of correct code:
async function good() {
await promise;
}