Is it possible to scan all files in a directory without @flow?
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
### What I want
- The behavior of `all=true` in a single directory (e.g. src)
- The default behavior of `all=false` outside that directory
### My motivation
I want my project to check types for every project file, without exception. Adding `@flow` isn't just tedious and doesn't just produce noise. It's also a thing I can forget to do (as can any other contributor to my project), which could let errors slip through without notice.
### What I've tried
Admittedly, I'm new to Flow, and the JS world has changed a lot since I last did any serious work with it. I've tried to the best of my knowledge to understand the docs for configuration. I've tried the following:
- `all=true`: this runs for a long time, pegging all of the cores of my CPU and consuming numerous GB of RAM. It's unclear if it will ever complete, but even if it does the time and resources needed are not suitable for a brand new project, let alone anything of any complexity.
- `all=true`, ignoring `.*/node_modules/`: this causes errors like `react-native. Required module not found`. As a result, anything imported does not appear to get type checked.
- `all=true`, ignoring `.*/node_modules/`, including `.*/node_modules/react-native/`: no change.
- Installing `flow-typed` (per a friend's recommendation): no change.
- Adding `src/` under `[include]` (with `all=false`): the files are not scanned.
- Adding `src/` under `[libs]` (with `all=false`): this actually works the way I want, but I've been warned that this is not safe as `libs` is looking for type definitions, not source files, and the type def format could change.
### What I'm not looking for
A new IDE or editor (or extension of either), script or additional bit of tooling that automatically generates boilerplate in every single file I create given the appropriate incantation. This is an additional moving part that can break or be forgotten, and I'm already overwhelmed by the number of things I need to do to write JS now. It also does not protect my project from other contributors who may not have said tooling.
Contributor guide
Assessment
This issue has not been assessed yet.