prefer-await-to-then
Configuration
rslint.config.ts
Rule Details
Prefer async/await over .then()/.catch()/.finally() for consuming Promise values.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
By default, .then()/.catch()/.finally() inside an await or yield expression, or inside a class constructor, are not reported — those positions cannot trivially be rewritten with await.
Examples of correct code for this rule in default (non-strict) mode:
strict option
When strict: true, the rule also reports .then()/.catch()/.finally() inside await/yield expressions and constructors.