Description
(This becomes possible only with Flow v0.84, which we'll get as part of #3399; so it's blocked on that. And completely finishing it is blocked on later work in upstream Flow.)
Generally almost all our object types should be exact object types. See discussion in 61d2e34 and 7037393... and see the many examples in git log --grep exact
of type errors that had been concealed by inexact object types and were discovered by making the object types exact.
The Flow team agrees, and they have been making changes to make it easier to work that way across a codebase:
https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf
We've already gone and made the bulk of our object types exact; see 61d2e34, 7037393, and 8370002 . With Flow v0.84, it becomes possible to explicitly mark as inexact the few types we actually want to describe that way. This task is to
- do that;
- for the remaining types that should be exact but aren't, make them exact (and fix whatever type errors stopped us from doing that before);
- make sure we really have gotten every case of the previous two steps (with that flowlint promised in "Step 1" of the roadmap post linked above -- which doesn't seem to exist yet).