New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSDoc duplicating method names is documentation API #2049
Comments
I have a solution to this problem. While the way you and I formatted these class comments makes complete sense, we've actually done it wrong. 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. class ACME {
/**
* 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;
}
}
export default ACME; @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 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: