react-native - 流程如何与本机反应和选项'all = true'一起使用?
问题描述
我想使用选项'all = true'。但我不想解析 node_modules 文件夹。
但我收到一个错误:无法解析模块 react-native。
我的配置:
[ignore]
.*/node_modules/*
[include]
[libs]
[lints]
[options]
all=true
[strict]
[untyped]
.*/node_modules/react-native
另一个配置(也不起作用):
[ignore]
.*/node_modules/*
[include]
[libs]
[lints]
[options]
module.system.node.resolve_dirname=node_modules
all=true
[strict]
[untyped]
.*/node_modules/react-native
有任何想法吗?
解决方案
这与导致模块解析器忽略匹配文件的 [ignore] 配置部分不同,这本质上使它们未经类型检查,并且也无法通过 import 或 require 解析。
通过放入流配置.*/node_modules/*
的[ignore]
部分,您可以阻止 Flow 解析模块。您可以通过从该部分中删除node_modules
目录(或者如果您想继续忽略其他节点模块,则仅删除包)或通过为. 我建议不要忽略所有节点模块,因为这会导致每个模块导入的 Flow 出现问题。[ignore]
react-native
[libs]
react-native
推荐阅读
- angular - 如何有效地向套接字服务器发送连续的时间更新事件流?
- ruby-on-rails - 创建并保存对象后,Hero_id 和 Villain_id 为 nil,嵌套路由无法导航到正确路径
- r - 使用 left_join 提取数据时的困难
- python - 为什么我的程序返回 IndexError?
- javascript - 为什么 JSON 响应可以在 Javascript 响应中以不同方式访问
- javascript - ReactJS:Javascript 不针对反应中的 div 元素,而是针对 html 中的 div 元素
- sas - 如何在 SAS 中将字符串(2013 年 1 月)转换为日期(201301)值?
- php - 下载文件,用户决定在哪里找到它
- c# - 我可以使用字典来根据我称为键的变量的值来决定采取哪些操作吗?
- c - poll(2) 在与 Web 服务器的连接上未检测到 POLLIN