facebook / facebook/flow

check-contents seems to be defaulting to --all

Open
#4,924 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

`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!
```

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.