Is there a way to make a correct description for a property with special symbols like "+" in jsdoc?
Example:
/**
* @typedef {Object} TestObject
* @property {string} "id+name"
*/
"id+name" seems to be an invalid syntax in this case.
Is there a way to make a correct description for a property with special symbols like "+" in jsdoc?
Example:
/**
* @typedef {Object} TestObject
* @property {string} "id+name"
*/
"id+name" seems to be an invalid syntax in this case.
You need to review what is the @property according to documentation. Basically this is variable name inside a class. Right? In this case you should follow JS convention for variable names. This is the reference to the post discover it ... What characters are valid for JavaScript variable names?. Obviously the variable name "id+name" is not valid. The following are accessors to this property ...
TestObject.id+name // fail
TestObject["id+name"] // would work for most of the browsers
The question to JSDoc creators, how they verify properties of specific type @property tag. I strongly believe they would point on the same JS convention for variable names. Sure enough you may not accept it as the answer on your question. Maybe somebody else or somebody from JSDoc team will provide with better idea.