-
-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Description
Description
Currently the rule is not enforced if a chain in async/await is correctly established. It could possibly have strict option to get rid of promise methods and prefer await completely.
Steps to Reproduce
async function doQuery() {
await query
.then(() => { console.log('complete') })
.catch(() => { console.log('error') })
}Expected behavior:
Both then and catch trigger linter error.
Actual behavior:
The error is triggered with then and only if await is missing.
Versions
[Please fill this in if you are submitting a bug report]
- Node version: v16.13.2
- ESLint version: 7.32.0
- eslint-plugin-promise version: 6.0.0
Additional Information
Related: #187
arahatashun, thodoo, dimaMachina, atjallen, laurent22 and 2 more