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

Required and optional parameters are not distinguished. #298

Open
fabpico opened this issue Feb 22, 2024 · 0 comments
Open

Required and optional parameters are not distinguished. #298

fabpico opened this issue Feb 22, 2024 · 0 comments

Comments

@fabpico
Copy link

fabpico commented Feb 22, 2024

Similar to #160 but it sounds that Github has a magic behavior that solves it. I don't let render the markdown in Github, but in Storybook. And in Storybook it looks the same as in PhpStorm.

So the official docs of @param says:

Optional parameters and default values
The following examples show how to indicate that a parameter is optional and has a default value.
An optional parameter (using JSDoc syntax)

/**
 * @param {string} [somebody] - Somebody's name.
 */

So when I do this (I need extra @module to let the Markdown content being created)

/**
 * @module
 * @param {string} [somebody] - Somebody's name.
 */

The rendered results has no explicit optional indication.

PhpStorm

Storybook

When I add a required parameter

/**
 * @module
 * @param {string} somebodyRequired
 * @param {string} [somebody] - Somebody's name.
 */

There is still no explicit distinction, except the in-name literal brackets.

PhpStorm

Storybook

Same problem when using @property

/**
 * @module
 * @property {string} somebodyRequired
 * @property {string} [somebody] - Somebody's name.
 */

PhpStorm

Storybook

What is expected
My expectation is that an additional column should be rendered, which explicitely indicates if the param is required or optional.

@fabpico fabpico changed the title Required and optionl parameters are not distinguished. Required and optional parameters are not distinguished. Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant