.flowconfig [libs]
.flowconfig
文件中的 [libs]
部分告诉 Flow 在对代码进行类型检查时包含指定的 库定义。可以指定多个库。默认情况下,项目根目录中的 flow-typed
文件夹作为库目录包含在内。此默认值允许你使用 flow-typed
安装库定义,无需额外配置。
¥The [libs]
section in a .flowconfig
file tells Flow to include the
specified library definitions when type
checking your code. Multiple libraries can be specified. By default, the
flow-typed
folder in your project root directory is included as a library
directory. This default allows you to use
flow-typed
to install library
definitions without additional configuration.
[libs]
部分中的每一行都是你要包含的库文件或目录的路径。这些路径可以是相对于项目根目录的路径,也可以是绝对路径。包含目录会递归地包含该目录下的所有文件作为库文件。
¥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.