後からFlowを導入してまだ型が無い時とかに。
any
型を付けちゃう
const a: stirng = 1;
// number This type is incompatible with string
const b: any = 2;
// no error
$FlowFixMe
コメントを前の行に書く
// $FlowFixMe
const c: string = 3;
// no error
ただこのコメントのパターンは設定で変えれるみたいです。
.flowconfig
[options]
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
suppress_type
を使う
options.suppress_type
で設定したワードを仮の型で使えるようになる。ちなみに、複数指定できるぽい。
.flowconfig
[options]
suppress_type=$FlowFixMe
suppress_type=$FixByNextMonth
こんな感じで、
const a: $FlowFixme = 1;
function b(): $FixByNextMonth {
return 'foo';
}