【发布时间】:2016-11-08 14:17:32
【问题描述】:
我在新的https://github.com/davezuko/react-redux-starter-kit 项目中使用flow init 初始化了流程项目。
当 Flow 进行检查时,它会在 node_modules 中发现几个错误。 /* 流 */ 带注释的库文件中发生错误。
看起来像这样:
node_modules/editions/source/index.js:33
33: const {name, editions} = require(packagePath)
^^^^^^^^^^^^^^^^^^^^ The parameter passed to require() must be a literal string.
node_modules/fbjs/lib/Deferred.js.flow:60
60: Promise.prototype.done.apply(this._promise, arguments);
^^^^ property `done`. Property not found in
474: declare class Promise<+R> {
^ Promise. See lib: /private/tmp/flow/flowlib_d34ebcf/core.js:474
node_modules/fbjs/lib/shallowEqual.js.flow:29
29: return x !== 0 || 1 / (x: $FlowIssue) === 1 / (y: $FlowIssue);
^^^^^^^^^^ identifier `$FlowIssue`. Could not resolve name
我应该让 Flow 忽略这些文件吗?我认为它可能会影响类型检查的正确性。
【问题讨论】:
标签: javascript flowtype