facebook / facebook/flow

Document @flow pragmas better

Open
#1,382 7 comments 0 reactions 0 assignees View on GitHub
Needs docs
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

The docs about the `@flow` pragma are kind of hard to find without reading lots of prose. It's mentioned in http://flowtype.org/docs/five-simple-examples.html, http://flowtype.org/docs/new-project.html and http://flowtype.org/docs/existing.html, but I think it probably deserves its own section.

The last page also mentions `@flow weak` which I'm not sure still works as described.

Nothing mentions `@noflow` yet. This mode should be thought of as something like `@flow suppress`, which parses the file as a Flow file (types are parsed) but suppresses all of the errors. This differs from the pragma missing entirely, which causes Flow to ignore the file. The reason it's `@noflow` instead of `@flow suppress` is because `@noflow` is not a prefix of `@flow`, so naive tooling can look for `@flow` without having to negative-match `suppress`.

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.