3 ms·
I'd prefer that approach too, as I can also document things at the same time as providing type annotations; flow-jsdoc looks interesting, but I don't know how e
by insin 10y ago
I'd prefer that approach too, as I can also document things at the same time as providing type annotations; flow-jsdoc looks interesting, but I don't know how easy it would be to plug into a Babel/Webpack+Babel workflow:
https://github.com/Kegsay/flow-jsdoc https://github.com/Kegsay/flow-jsdoc
- damncabbage 10y agoThere's also comments support in Flow directly, but it's sadly (but understandably) hideous: function somefunction(somestring/*: string*/)/*: boolean */ { var ret/*: boolean */; ... return ret; } (See https://flowtype.org/blog/2015/02/20/Flow-Comments.html https://flowtype.org/blog/2015/02/20/Flow-Comments.html)
- Lio 10y agoMight be worth pointing out, the "documentation" package[1] can be used to generate jsdoc annotations suitable for Google Closure compiler from Flow type annotations. It can also build really nice HTML documentation to. [1] https://www.npmjs.com/package/documentation https://www.npmjs.com/package/documentation