0

根据标题,我似乎无法在Yarn Workspaces环境WebStorm 2019.2.1中使用 Flow 。我的大部分文件导入(但奇怪的是不是全部)都显示了这一点:

屏幕截图导入不起作用

如您所见,reactFlow 正确识别了导入,而styled-components没有正确识别导入。

请注意,运行yarn run flow不会导致错误。此外,自动完成和Cmd + Click导入工作完美。

值得一提的是,我遵循了 JetBrains 指南,了解如何使用 WebStorm 设置 Flow(此处),以下是我.flowconfig文件的内容:

[ignore]
<PROJECT_ROOT>/node_modules/.*config-chain/test/broken.json
<PROJECT_ROOT>/node_modules/@mapbox/jsonlint-lines-primitives/test/fails/*
<PROJECT_ROOT>/node_modules/react-universal-component/*
<PROJECT_ROOT>*/buildClient/*
<PROJECT_ROOT>/node_modules/mapbox-gl/src/style-spec/node_modules/jsonlint-lines-primitives/test/fails/*
<PROJECT_ROOT>/node_modules/mapbox-gl/src/style-spec/node_modules/@mapbox/jsonlint-lines-primitives/test/fails/*
<PROJECT_ROOT>/node_modules/redux-persist/lib/persistReducer.js.flow

[include]

[libs]

[lints]
# This must be turned off until a fix for https://github.com/flow-typed/flow-typed/issues/3008 is released
deprecated-utility=off

[options]
emoji=true
esproposal.optional_chaining=enable
module.name_mapper.extension='graphql' -> '<PROJECT_ROOT>/packages/marketing-site/internals/flow/graphqlMock'
server.max_workers=1

[strict]
4

0 回答 0