promise-function-async
Configuration
rslint.config.ts
Rule Details
Require any function or method that returns a Promise to be marked async. Ensures that each function is only capable of either returning a rejected promise or throwing an Error object. In contrast, non-async Promise-returning functions are technically capable of either. Code that handles both rejected promises and thrown errors simultaneously is often overly complex and hard to maintain.
Examples of incorrect code for this rule:
Examples of correct code for this rule: