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
A common pattern for a utility class is to have a @Private constructor (so that no instance can be made) and public static methods. JSDoc decides to not show the entire class in this case (when --access is set to not include private).
Additionally, the @classdesc needs to still appear for such a class, even though the constructor itself should not appear (when private access is turned off).
My current workaround is to not mark the constructor with @Private, and make the body of the constructor just throw an exception. But when reading the documentation it now looks like you can instantiate these classes. I can add a description explaining this, or add a @throws tag to the constructor, but far better is to just not show the constructor.
The text was updated successfully, but these errors were encountered:
FYI, adding a @throws tag to the constructor is looking like a good enough workaround for me -- plus it allows the @classdesc to appear (and other tags like @todo, @author).
A common pattern for a utility class is to have a @Private constructor (so that no instance can be made) and public static methods. JSDoc decides to not show the entire class in this case (when --access is set to not include private).
Additionally, the @classdesc needs to still appear for such a class, even though the constructor itself should not appear (when private access is turned off).
My current workaround is to not mark the constructor with @Private, and make the body of the constructor just throw an exception. But when reading the documentation it now looks like you can instantiate these classes. I can add a description explaining this, or add a @throws tag to the constructor, but far better is to just not show the constructor.
The text was updated successfully, but these errors were encountered: