We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Add support for type parameter defaults in JSDoc @template tags, to match parity with type parameter defaults in TypeScript:
@template
// ts type Foo<T = number> = T // js /** * @template [T=number] * @typedef {T} Foo */
jsdoc template type parameter default
My suggestion meets these guidelines:
Implement type parameter defaults in @template similar to optional parameters in @param:
@param
/** * @param {string} [x=1] - NOTE: TS parses the expression `1` but ignores it. */ function f(x) {} /** * @template {string} [T="hello"] * @typedef {T} Foo */
T
[name]
Improves JavaScript JSDoc type annotation parity with TypeScript type annotations.
Used for JavaScript development using the TypeScript language service.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Suggestion
Add support for type parameter defaults in JSDoc
@template
tags, to match parity with type parameter defaults in TypeScript:🔍 Search Terms
jsdoc template type parameter default
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
Implement type parameter defaults in
@template
similar to optional parameters in@param
:T
would be required (so as not to misinterpret existing documentation comments@param
which allows[name]
on its own).📃 Motivating Example
Improves JavaScript JSDoc type annotation parity with TypeScript type annotations.
💻 Use Cases
Used for JavaScript development using the TypeScript language service.
The text was updated successfully, but these errors were encountered: