If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

NEW
Unassigned

Status

()

Toolkit
Async Tooling
5 months ago
a month ago

People

(Reporter: Paolo, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 months 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

5 months 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.