Reputation: 176
I'm a student who's capstone project/work intergrated learning is about to end. I'm working on producing technical documentation to hand off to the next team that will continue on with this work, but I've hit a snag.
My class methods that use arrow functions aren't generating params documentation when I create documentation using the jsdoc
tool.
The documentation works as intended in visual studio code/intellisense:
I've been googling around to try and figure out what the problem was, but I failed to find anything.
I mean, my research yielded:
Of note is that I'm using the jsdoc-export-default-interop
plugin so that jsdoc will actually generate things for export default [CLASS OR FUNCTION]
.
Upvotes: 2
Views: 1955
Reputation: 176
However, while it is good enough for my purposes, I'm not entirely sure it's acurate and would be happy to hear critisims, other people's viewpoints and solutions. I'll explain the concerns I have at the end.
I have no idea why VSCode is able to detect it automatically, but it appears the JSDoc tool cannot. Here it is stated in the official documentation
Link to documentation: (https://jsdoc.app/tags-function.html)
@function
tag (or an alias like @method
).By documenting the class member with the @function
tag like so:
I am able to get the arrow function to generate as a class method, and get params documentation:
Well the biggest concern/annoyance is now I need to go through all the source code and add a bunch of @function
tags. Ah whelp.
Other concerns are that I may have misunderstood the problem/I'm not quite sure if this is best practice.
And I'm not too certain if this documentation is accurate in terms of if there is actually a tangible difference between a class member arrow function and a class method that I need to capture in the API documentation.
Anyway, I think this will be what I go with, but I'll be monitoring this answer to read any input/feedback :)
Upvotes: 4