The any types in the index.js.flow file, combined with the
@flow strict at the top, cause Flow to give errors when run
with a typical .flowconfig, one with the recommended set of
lints under [strict].
That in turn happens when running Flow on a project that uses
this one, if using yarn link to use a checkout of the Flowgen
repo instead of a copy of the built artifact from NPM. Which is
a handy thing to do when developing changes to Flowgen and
testing them in a project that uses it.
Instead, to avoid those errors, we can just say $FlowFixMe.
It has the same semantics as any, but because it explicitly
acknowledges that something's missing, the strict-mode linters
don't complain about it.
Also add tiny comments to indicate what the types are really
supposed to be. While looking those up, we find that one of
them is any in the actual implementation, but easily fixed;
fix that too.
The
any
types in the index.js.flow file, combined with the@flow strict
at the top, cause Flow to give errors when run with a typical.flowconfig
, one with the recommended set of lints under[strict]
.That in turn happens when running Flow on a project that uses this one, if using
yarn link
to use a checkout of the Flowgen repo instead of a copy of the built artifact from NPM. Which is a handy thing to do when developing changes to Flowgen and testing them in a project that uses it.Instead, to avoid those errors, we can just say
$FlowFixMe
. It has the same semantics asany
, but because it explicitly acknowledges that something's missing, the strict-mode linters don't complain about it.Also add tiny comments to indicate what the types are really supposed to be. While looking those up, we find that one of them is
any
in the actual implementation, but easily fixed; fix that too.