facebook / facebook/flow

Replace /* @flow */ with entry in .flowconfig

Open
#284 52 comments 88 reactions 0 assignees View on GitHub
feature request flowconfig
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

When introducing Flow to legacy code, it's nice to specify on a per-file basis what files Flow should analyze. Thus, we have the `/* @flow */` or `/* @flow weak */` comments at the top of each file. Once Flow is widely used in a project, I imagine that this would become extremely tedious. Or worse, someone may accidentally fail to include the comment and then we'll have no protection on that file with no warning that we don't. I suppose `flow check --all` exists for these cases, but that's an extremely inflexible solution.

Couldn't all these cases (analyze a few files, most files, or all files from a project) be solved more simply by providing a way to specify a glob or regex in .flowconfig that determines what files to analyze? That's what I assumed the `[include]` option was for, but it looks like it still requires the files listed to include the `/* @flow */` comment (so it's more for checking files in a folder outside the one where .flowconfig is located).

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.