It's fairly common to get errors within node_modules
when upgrading Flow, but this makes a bunch of errors go away:
[declarations]
<PROJECT_ROOT>/node_modules/.*
Also, I assume it significantly cuts down on the amount of stuff Flow has to process, since
In declaration mode the code is not typechecked. However, the signatures of functions, classes, etc are extracted and used by the typechecker when checking other code.
Yet this isn't the default. Is there any reason I shouldn't do it? If the type signatures themselves have errors (like a class implementing an interface but differing in method types, or installed flow-typed defs differing between library and consuming project), would it fail to report some errors in my code that uses those type signatures?
I should note because AFAIK Flow still doesn't have a tool to output definitions only from source code*, I've just been copying the entire source files to .js.flow
in many of our internal packages. So errors occur when upgrading Flow in projects that use those packages. However I've seen errors even from within the version of graphql
that we're currently on.
*The print-signature
CLI command mentioned in the docs doesn't actually appear to exist when I try to use it.