The main takeaway for me is that TS is much much less sound than Flow. That means it checks less invariants which in turn makes you less trust it...
Consider the following code which is valid (!) in TS:
let promisedString: Promise<string> = new Promise(
resolve => {
// Perfectly valid in TypeScript!
resolve(42)
}
)
Another downside of TS is poor type inference. It requires to annotate each top level function while Flow only requires to annotate exported functions.Even the following simple piece of code will make TS ask you to annotate doAddition function:
export function addition(a: number, b: number) {
return doAddition(a, b)
}
function doAddition(a, b) {
return a + b
}
I'm really glad Flow doesn't force me into it.Edit: spelling