Closed AlexanderZeilmann closed 9 years ago
Yeah, I'm not sure about ES6 support for now. ;-( Thanks for the report, at the first look I agreed with you.
But probably there is a way to check them as a usual case. Do you really need to describe {Object}
as separate @param
?
I would suggest to use:
/**
* @param {Object} anyName
* @param {String} anyName.prop1
* @param {Number} anyName.prop2
*/
But for now it's easier to disable these validations and when ES6 will be jsdocable — just integrate them back.
Would you like to tackle this?
Hmm, yeah perhaps it is a little bit to early to do stuff like this. Especially since JSDoc currently requires the name of the parameter. I opened a bug regarding this topic over at the jsdoc repo: https://github.com/jsdoc3/jsdoc/issues/987
Anyway, I created a pull request over at #92.
These days I'm often using the following pattern to pass variables to functions
This leads to the problem, that the destructuring object doesn't have a name, which is required by
checkParamNames
.Giving the parameter no name, leads to the
Missing param name
errorGiving it a random name leads to the
Expected undefined but got object
error.Trying to hack it with undefined gives a
Parameters undefined and undefined are out of order
error.My .jscsrc:
Is there a way I can get this to work properly? If there is nothing implemented right now, I would suggest automatically disabling the
checkParamNames
rule for destructuring parameters. Thoughts?