-
Notifications
You must be signed in to change notification settings - Fork 200
Description
I have some existing jsdocs and I want to use esdoc for its es6 support. I hit a snag...
It looks like the esdoc relies on the extra *s being precisely positioned. This really threw me for a while. I would suggest that the doc tags be read properly even though they are not proceeded by a star or the spacing after the star varry.
For example, this does not parse the args into a table:
/**
* this is object destructuring.
* @param {Object} param - this is object param.
* @param {number} param.foo - this is property param.
* @param {string} param.bar - this is property param.
*/
export function myFunc({ foo, bar }){}Instead of a table, the text falls through: this is object destructuring. @param {Object} param - this is object param. @param {number} param.foo - this is property param. @param {string} param.bar - this is property param.
But this works:
/**
* this is object destructuring.
* @param {Object} param - this is object param.
* @param {number} param.foo - this is property param.
* @param {string} param.bar - this is property param.
*/
export function myFunc({ foo, bar }){}This is not easy to figure out if the docs have other things going on (like my real test case). I would suggest that the parsing not depend on the asterisk at all. Or, at least put a warning about this in your docs.
The ideal implementation should consider many variants including this one valid :
/**
this is object destructuring.
@param {Object} param - this is object param.
@param {number} param.foo - this is property param.
@param {string} param.bar - this is property param.
*/
export function myFunc({ foo, bar }){}In version 0.4.3