You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect only the method displaying the return values to be displayed. I suspect the both class and the module above it are generating all methods inside of them, but I can't seem to figure out why that would happen.
Current behavior
Your environment
Software
Version
JSDoc
4.0.2
Node.js
14.20.1
npm
6.14.17
Operating system
The text was updated successfully, but these errors were encountered:
While the way you and I formatted these class comments makes complete sense, we've actually done it wrong.
I'm not sure why it's the way it is and it doesn't align with what's shown on the better-docs main page.
Instead of giving the class a description and then giving one to the constructor, you're actually supposed to attach the whole thing to the constructor and NOT to the class. Remove the comment on the class itself and then add something like this to your constructor.
classACME{/** * The path to the json file that appointment IDs of sent reminders will be stored for future reference. * @type {string} */remindersSentPath: string;/** * @classdesc ACME API interaction. * @description Setup an instance of the ACME class. * @constructor * @param {string} remindersSentPath The path to the reminder sent history json file. */constructor(remindersSentPath: string){this.remindersSentPath=remindersSentPath;}}exportdefaultACME;
@classdesc should be the description of the class itself, but it should be included with the constructor, NOT the class definition. No idea why but this is what makes it work properly. This will also fix the duplication of the class members (see remindersSentPath in example).
Absolute pain figuring this out. Hope this saves everyone who runs into the same issue. The documentation needs to be updated to reflect this.
Side Note: If your class doesn't have a constructor, you can just do the normal comment on the class itself and it'll work fine. This only appears to be an issue if you have both a constructor and a class block comment block. You should prefer the constructor block though and just define the class information in it.
Input code
JSDoc configuration
JSDoc debug output
Expected behavior
I would expect only the method displaying the return values to be displayed. I suspect the both class and the module above it are generating all methods inside of them, but I can't seem to figure out why that would happen.
Current behavior
Your environment
The text was updated successfully, but these errors were encountered: