javascript - 如何让 .flowconfig 从文件夹中读取类型?

标签 javascript flowtype

我有一个名为interfaces的文件夹:

enter image description here

finale.js中,我有:

// @flow 
type finaleContext = {
    instance: string
}

export type { finaleContext }

我希望它能够被流程接收。在 .flowconfig 中,我尝试了:

[libs]
./interfaces/*.js

它仍然提示:无法解析名称 FinaleContext。

那么我怎样才能将所有这些接口(interface)作为定义包含进来呢?

最佳答案

Each line in the [libs] section is a path to the library file or directory which you would like to include. These paths can be relative to the project root directory or absolute. Including a directory recursively includes all the files under that directory as library files.

https://flow.org/en/docs/config/libs/

所以,我认为你可以写

[libs]
interfaces

关于javascript - 如何让 .flowconfig 从文件夹中读取类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57896797/

相关文章:

javascript - 为什么ajax请求时字符 "+"没有发送到php文件?

css - 样式表.create "not covered by flow"

javascript - React 渲染方法的正确 Flow 类型?

javascript - ImmutableJS/FlowType : Is it possible to typeCheck an array returned by a List. toJS()

javascript - 在 Flow 0.34 中定义自定义 `toString`

javascript - 循环浏览页面以在 Protractor 中创建测试

javascript - 使用brain.js(js中的神经网络)来学习元素背景图像的对比度

javascript - JavaScript 对象只是一个关联数组吗?

javascript - flowtype 绑定(bind)导致错误 `Convariant property incompatible with contravariant use in assignment of property`

javascript - React- 如何使用本地范围的 css 和来自第三方组件的 css