I'm trying to create type definition in Flow for one of my objects. I'm not sure whether Flow support Symbols
, but in such cases how could I skip this warning?
const version: Version = this.getVersion(12345);
const upLink: string = version[Symbol.for('__my_amazing_symbol')];
But on validating the line above, I have the following error on run 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
This is my type of such object.
declare export type Version = {
name: string;
version: string;
};
Flow config
[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