The difficulty comes from how dynamic language features you support & how accurate the type is inferred. Both in typescript and flow, you need to write annotations/comments to help the compiler perform well.
ESInfer is doing it all statically and without additional stuff needed. You can try it out on the playground section at the bottom of the homepage. Would be glad if there is any feedback :)