facebookarchive/flow-remove-types

Flow-remove-types does not handle functions/object without explicit argument/key names

mourner opened this issue · 4 comments

// works
type A = {[key: string]: string};
type B = (foo: string) => string;

// works in flow, but flow-remove-types fails
type A = {[string]: string};
type B = (string) => string;

Flow documentation is not clear on the syntax and whether omitting names like this should be allowed, but Flow 0.35 parses such definitions without any errors. So flow-remove-types probably should too. cc @leebyron

hzoo commented

@mourner this is a new flow feature - it's not supported since babylon just added it and it's not released yet either babel/babylon#197

@hzoo awesome, thanks!

hzoo commented

It's possible that flow-remove-types may need it's own changes after we release (soon) but just fyi yeah