如何在流配置中包含来自忽略的node_modules的路径 [英] How to include path from ignored node_modules in flow config
问题描述
我具有用于忽略"node_modules"内部所有文件夹的流配置
I have flow config for ignoring all folders inside 'node_modules'
但是我想包含一个文件夹,如何使用流配置来做到这一点?
But I want to Include one folder, how can I do this using flow config?
似乎我的配置不起作用,文件夹date-fns
仍然被忽略.
Seems that my config doesn't work and folder date-fns
is still ignored.
[ignore]
<PROJECT_ROOT>/node_modules/.*
[include]
<PROJECT_ROOT>/node_modules/date-fns/
推荐答案
我也想忽略所有的node_modules,因为除了一些软件包之外,它大大降低了解析速度,但是我无法使用include来工作预期的.
I also wanted to ignore all of node_modules because it was slowing down the parsing considerably except for a few packages but I couldn't get the include to work as I expected.
对我来说,我想解析一个有作用域的目录,因此我在ignore部分中编写了ocaml正则表达式.
For me I wanted a scoped dir to be parsed so I wrote an ocaml regex in the ignore section.
这将忽略node_modules中的所有内容,除了不是以@
This will ignore everything in node_modules except for anything not starting with alpha characters like @
[ignore]
.*node_modules/[a-z].*
如果您想编写自己的正则表达式,这可能会有所帮助 https://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html
This might help if you wanna write your own regex https://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html
这篇关于如何在流配置中包含来自忽略的node_modules的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!