facebook / facebook/flow

`typeof mixed === 'object' && mixed` should not report sketchy-null-mixed

Aperta
#4,524 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
linter
Lingua principale
Rust
Stelle
22.3k
Fork
1.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Consider these 2 snippets:

```javascript
declare var m : ?mixed;
if (typeof m === 'object' && m) {
/*snip*/
}

if (typeof m === 'object') {
if (m) {
}
}
```

In the first case flow-lint reports a `sketchy-null-mixed` error, while in the second case it does not. I think that flow should not report an error in both cases, since the only falsy value with type === 'object' is `null`.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.