facebook / facebook/flow

Warn when promises are used as value

Open
#3,862 10 comments 3 reactions 0 assignees View on GitHub
feature request linter
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Flow should warn when we try to use a promise as a value inside an `if` statement

```js
if (promiseReturningFunction()) {}
```
The scenario below however should still be okay

```js
if (await promiseReturningFunction()) {}
```

Let me know if I any further explanation is required. Thank you all for working on Flow!

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.