Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR demonstrates how we can start tightening up our typing with Flow strict mode:
https://flow.org/en/docs/strict/
Strict mode enables stronger safety guarantees by banning unsafe types such as
any
, which currently plague our codebase with a false sense of safety, allowing for serious bugs to slip through.any
is kind of a virus — any code that touches it gets "tainted", and we used it a lot, leaving its removal for later. As a result, basically the majority of our codebase is unsafely typed (which is often not better than untyped).Strict mode on the other hand is viral too — you can enable it on a file-by-file basis, and it enforces every import to be strictly typed too. That means we can start with typing "leaves" and external dependencies, and go up the tree until we type out everything.
In this PR, I started with typing a few utility files and a few dependencies. We can merge it to get the config in, and then gradually type the rest of the code base with a succession of minimal PRs.