Skip to content
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 @param not displaying arrays #1611

Closed
isaacbuckman opened this issue Jun 11, 2020 · 2 comments
Closed

JSDoc @param not displaying arrays #1611

isaacbuckman opened this issue Jun 11, 2020 · 2 comments

Comments

@isaacbuckman
Copy link
Contributor

I am having some trouble setting the type of an @param to a string[]

/**
* @param{string[]} baz Argument of type string[]
* @param {string} bar Argument of type string
*/

image
I expected it show that the type of baz is a string[]. Similar to #802, string[], String[], Array.<string>, etc. do not seem to be working either.

It looks like the type name is being rendered here:

When the type is a string, doctrine is giving us { type: 'NameExpression', name: 'string' } so we can get type.name.

When the type is a string[], doctrine is giving us:

{
  type: 'TypeApplication',
  expression: { type: 'NameExpression', name: 'Array' },
  applications: [ { type: 'NameExpression', name: 'string' } ]
}

As a side note, it might be nice to put each argument on a newline.

Would love to hear your thoughts and submit a pull request with some of these changes.

@sapegin
Copy link
Member

sapegin commented Jun 22, 2020

Yeah, all good points! Feel free to send a pull request! 👾

isaacbuckman added a commit to isaacbuckman/react-styleguidist that referenced this issue Jul 3, 2020
@styleguidist-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 11.0.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants