-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
Suggestion
Optional jsdoc parameters are currently lost on @param
: https://jsdoc.app/tags-param.html
π Search Terms
jsdoc optional params
β Suggestion
Please allow for optional params parsing
/**
* @param {string} [somebody] - Somebody's name.
*/
export function sayHello(somebody) {
}
currently parses to tags:
{
name: "param",
text: [
{
text: "somebody",
kind: "parameterName",
},
{
text: " ",
kind: "space",
},
{
text: "- Somebody's name.",
kind: "text",
},
],
},
Possible suggestions:
- add a node kind:
optional
, - or keep the square brackets around the name so users have a way to parse the optional parameter name:
{
text: "[somebody]",
kind: "parameterName",
},
π Motivating Example
example test to reproduce https://github.com/atanasster/ts-issues/blob/master/tests/optional-param.test.ts
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.