Files
react/scripts/flow/config/flowconfig
Andrew Clark 52a0d6b5ab Make Flow work with your editor (#18664)
We typecheck the reconciler against each one of our host configs.
`yarn flow dom` checks it against the DOM renderer, `yarn flow native`
checks it against the native renderer, and so on.

To do this, we generate separate flowconfig files.

Currently, there is no root-level host config, so running Flow
directly via `flow` CLI doesn't work. You have to use the `yarn flow`
command and pick a specific renderer.

A drawback of this design, though, is that our Flow setup doesn't work
with other tooling. Namely, editor integrations.

I think the intent of this was maybe so you don't run Flow against a
renderer than you intended, see it pass, and wrongly think you fixed
all the errors. However, since they all run in CI, I don't think this
is a big deal. In practice, I nearly always run Flow against the same
renderer (DOM), and I'm guessing that's the most common workflow for
others, too.

So what I've done in this commit is modify the `yarn flow` command to
copy the generated `.flowconfig` file into the root directory. The
editor integration will pick this up and show Flow information for
whatever was the last renderer you checked.

Everything else about the setup is the same, and all the renderers will
continue to be checked by CI.
2020-04-18 10:24:46 -07:00

60 lines
1.3 KiB
Plaintext

[ignore]
.*/scripts/bench/.*
.*/build/.*
# These shims are copied into external projects:
.*/rollup/shims/facebook-www/.*
.*/rollup/shims/react-native/.*
.*/node_modules/@snyk/.*
.*/node_modules/y18n/.*
.*/node_modules/chrome-devtools-frontend/.*
.*/node_modules/devtools-timeline-model/.*
.*/node_modules/create-react-class/.*
.*/node_modules/react-native-web/.*
.*/__mocks__/.*
.*/__tests__/.*
# TODO: noop should get its own inlinedHostConfig entry
.*/packages/react-noop-renderer/.*
%REACT_RENDERER_FLOW_IGNORES%
[include]
./node_modules/
./packages/
./scripts/
[libs]
./node_modules/fbjs/flow/lib/dev.js
./scripts/flow/environment.js
./scripts/flow/react-devtools.js
./scripts/flow/react-native-host-hooks.js
./scripts/flow/react-relay-hooks.js
[lints]
untyped-type-import=error
[options]
server.max_workers=4
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
# Substituted by createFlowConfig.js:
%REACT_RENDERER_FLOW_OPTIONS%
munge_underscores=false
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_type=$FlowExpectedError
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
[version]
^0.97.0