-
Notifications
You must be signed in to change notification settings - Fork 7
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
module-based namepaths result in wrong name in TSD #39
Comments
Here is a workaround where I updated my JSDoc to use appropriate namepaths, for |
Like you have mentioned, this module currently has problem in general with full qualified namepaths. The issue is in function mapVariableType. To fix this, we need to implement a mechanism which resolve the passed namepath to an already parsed type definition. Therefore you need to search for the requested item in the private member One thing to note:
this code won't work because the definition of Summarized:
|
Let's say I have a
@module
with an inner@typedef
:If I wanted to pass
MyType
as a@param
to a function or as a@property
of another@typedef
, based on JSDoc convention you should use a namepath whenever using modules like this:jsdoc
and related templates (like the template to convert to markdown) handle this properly but whenever@otris/jsdoc-tsd
generates the TSD, I get something like this:So instead of
obj: MyType
, I getobj: module:my-module~MyType
. The same thing happens when you use a namepath for any other place where a namepath is used, like@property
.The reason this has come up is that my JSDoc either generates proper TSD (via
@otris/jsdoc-tsd
) or MD (viajsdoc2md/jsdoc-to-markdown
) but never both at the same time. I realize thatjsdoc2md/jsdoc-to-markdown
could very well be the culprit but when I looked into this from the JSDoc site, it looks like any namepath should be fully-qualified when using modules.The text was updated successfully, but these errors were encountered: