gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 22:58:08 24 4
gpt4 key购买 nike

我有一个名为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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com