unicorn/no-unnecessary-await Correctness
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;
}
How to use
To enable this rule in the CLI or using the config file, you can use:
bash
oxlint --deny unicorn/no-unnecessary-await
json
{
"rules": {
"unicorn/no-unnecessary-await": "error"
}
}