2 ms·
Why not both? I just installed flow and checked the JavaScript output of my TypeScript project (~2000 lines) and was a little disappointed it didn't turn up any
by labrador 10y ago
Why not both? I just installed flow and checked the JavaScript output of my TypeScript project (~2000 lines) and was a little disappointed it didn't turn up any errors.
- AgentME 10y agoFlow only type-checks files that have opted into it with the //@flow comment. It will have some trouble dealing with the compiled output of another tool like Typescript. For example, it probably wouldn't understand that output of how Typescript compiles classes into ES5 represents a class. Even if using both of them on the same code worked, Flow and Typescript are both a bit anal about certain dynamic javascript patterns, and I think any possible extra gains from having both check your code would be canceled out by having to write your code in ways to please both type-systems.
- labrador 10y agoI made the necessary mods (flow doc is not very clear by the way) and thought it was funny flow complained about TypeScript emitting this: var live_items = new Array(); ^^^^^^^^^^^ Use array literal instead of new Array(..)