我试图创造流量类型定义为我的对象之一。 我不知道是否流支持Symbols
,但在这种情况下,我怎么能跳过这个警告呢?
const version: Version = this.getVersion(12345);
const upLink: string = version[Symbol.for('__my_amazing_symbol')];
但在验证上面的线,我对运行下面的错误flow check
。
Error: src/local.js:197
197: const upLink: string = version[Symbol.for('__my_amazing_symbol')];
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ access of computed property/element. Computed property cannot be accessed with
197: const upLink: string = version[Symbol.for('__my_amazing_symbol')];
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Symbol
Found 2 errors
这是我喜欢的类型,例如对象。
declare export type Version = {
name: string;
version: string;
};
流程配置
[ignore]
.*/node_modules/.*
lib/.*
[include]
[libs]
node_modules/@mod/types/lib/
[lints]
[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
unsafe.enable_getters_and_setters=true
[version]
^0.52.0