Skip to content

unicorn/no-unnecessary-await Correctness

This rule is turned on by default.
🛠️ An auto-fix is available for this rule for some violations.

What it does

Disallow awaiting on non-promise values.

Why is this bad?

The await operator should only be used on Promise values.

Example

javascript
async function bad() {
  await await promise;
}

References

Released under the MIT License.