私は自分のオブジェクトの1つにフロー定義の型定義を作成しようとしています。フローサポート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
あなたが/しようとしませんでした/ $ FlowFixMe行の前に、私はあなたの設定でそれを見ています – eenagy
あなたの質問のタイトルを編集してください、する必要があります:どのように私はフローシンボルエラーを抑制するのですか? – eenagy
// $ FlowFixMeは有効な回答でなければなりません。 :) わたしにはできる。私は提案のためにタイトルのおかげで更新します。 –