google / google/closure-compiler

Conformance Check: Promise Rejections Must be Caught

Open
#1,515 8 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I'd like to enforce that all promises have rejections caught. Either:

``` js
promiseReturningFunction()
.then(resFn, rejFn)
.then(resFn) //warning here
.then(resFn, rejFn);
```

or

``` js
promiseReturningFunction()
.then(resFn, rejFn)
.then(resFn) //no warning here - it's caught
.then(resFn, rejFn)
.catch(rejFn);
```

I could also see this as a lint check rather than a conformance requirement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.