Add an ESLint rule to detect some cases of promise chains that are not terminated

NEW
Unassigned

Status

()

2 years ago
2 years ago

People

(Reporter: Paolo, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
Most promise chains should end with ".catch(Cu.reportError);" or ".catch(() => {});".

We cannot detect all misuses, but we can likely detect the most common ones by checking that return value of ".then()" or a call to an async function is never ignored, but is stored in a variable, propagated via "return", or fed to ".catch()".
(Reporter)

Updated

2 years ago
Depends on: 1362970
We could potentially use some or all of the rules from this plugin: https://github.com/xjamundx/eslint-plugin-promise
You need to log in before you can comment on or make changes to this bug.