facebook / facebook/flow

check-contents seems to be defaulting to --all

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

Descrizione

`flow check-contents --help` lists this option:

```
--all Ignore absence of an @flow pragma
```

The existence of `--all` suggests that, by default, check-contents respects the absence of a @flow pragma. But this does not seem to be the case:

```
% flow version
Flow, a static type checker for JavaScript, version 0.54.1
% cat .flowconfig
[ignore]

[include]

[libs]

[lints]

[options]
% echo "class A extends B {}" | flow check-contents
Error: -:1
1: class A extends B {}
^ identifier `B`. Could not resolve name

Found 1 error
```

If I use the undocumented flag `--respect-pragma`, which I thought was the default, I get the behavior I'd expect without passing any flags:

```
% echo "class A extends B {}" | flow check-contents --respect-pragma
File is not @flow!
```

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.