4 ms·
This would be a little offtopic for this thread, but anyone knows if there is an example of using TypeScript with Node only as a typechecker (like flow)? Recent
by awalGarg 10y ago
This would be a little offtopic for this thread, but anyone knows if there is an example of using TypeScript with Node only as a typechecker (like flow)? Recently it was in news that TypeScript can understand JSDoc annotations - so I was wondering if I could use TypeScript as a typechecker for my code which is all 100% pure JS with JSDoc style type annotations.
I tried flow, but flow's comment syntax for type annotations is not compatible with JSDoc, and flow really needs a lot of work still. I am hopeful it will improve, but I feel presently it isn't ready for primetime for large codebases on the server side. (I guess it works great for React though).
Pretty new to TS but I like TS a lot as well!
- wwwigham 10y agoThe TS compiler is usually configured to disregard most type errors in JS (even if it does infer a bunch types from JSDoc comments); if this would be super super useful for you, you should consider making an issue or upvoting an existing issue for it on the TS repo!
- alxlu 10y agoI've found https://www.npmjs.com/package/documentation https://www.npmjs.com/package/documentation to handle JSDoc + Flow annotations reasonably well.