These days I'm often using the following pattern to pass variables to functions
var f = function ({prop1, prop2}) {
return prop1 + prop2;
};
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 error
/**
* [f description]
*
* @param {Object}
---^
* @return {String} Some string
*/
Giving it a random name leads to the Expected undefined but got object error.
/**
* [f description]
*
* @param {Object} object
--------------------^
* @return {String} Some string
*/
Trying to hack it with undefined gives a Parameters undefined and undefined are out of order error.
/**
* [f description]
*
* @param {Object} undefined
--------------------^
* @return {String} Some string
*/
My .jscsrc:
"jsDoc": {
"checkParamNames": true,
"checkRedundantParams": true,
"requireParamTypes": true,
"checkReturnTypes": true,
"checkRedundantReturns": true,
"requireReturnTypes": true,
"checkTypes": true,
"checkRedundantAccess": true,
"leadingUnderscoreAccess": "private",
"enforceExistence": true,
"checkAnnotations": true,
"requireReturnTypes": true,
"checkRedundantAccess": true,
"requireHyphenBeforeDescription": true
},
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?
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 nameerrorGiving it a random name leads to the
Expected undefined but got objecterror.Trying to hack it with undefined gives a
Parameters undefined and undefined are out of ordererror.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
checkParamNamesrule for destructuring parameters. Thoughts?