Skip to main content

.flowconfig [include]

.flowconfig 文件中的 [include] 部分告诉 Flow 包含指定的文件或目录。包含一个目录会递归地包含该目录下的所有文件。只要符号链接指向也包含在内的文件或目录,就会遵循符号链接。include 部分中的每一行都是要包含的路径。这些路径可以相对于根目录或绝对路径,并且支持单星和双星通配符。

¥The [include] section in a .flowconfig file tells Flow to include the specified files or directories. Including a directory recursively includes all the files under that directory. Symlinks are followed as long as they lead to a file or directory that is also included. Each line in the include section is a path to include. These paths can be relative to the root directory or absolute, and support both single and double star wildcards.

项目根目录(.flowconfig 所在的位置)会自动包含在内。

¥The project root directory (where your .flowconfig lives) is automatically included.

例如,如果 /path/to/root/.flowconfig 包含以下 [include] 部分:

¥For example, if /path/to/root/.flowconfig contains the following [include] section:

[include]
../externalFile.js
../externalDir/
../otherProject/*.js
../otherProject/**/coolStuff/

然后当 Flow 检查 /path/to/root 中的项目时,它会读取并监视

¥Then when Flow checks the project in /path/to/root, it will read and watch

  1. /path/to/root/(自动包含)

    ¥/path/to/root/ (automatically included)

  2. /path/to/externalFile.js

  3. /path/to/externalDir/

  4. /path/to/otherProject/ 中以 .js 结尾的任何文件

    ¥Any file in /path/to/otherProject/ that ends in .js

  5. /path/to/otherProject 下任何名为 coolStuff/ 的目录

    ¥Any directory under /path/to/otherProject named coolStuff/