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

Write type parameters instead of @template tags in JSDoc #27512

Open
DanielRosenwasser opened this issue Oct 3, 2018 · 0 comments
Open

Write type parameters instead of @template tags in JSDoc #27512

DanielRosenwasser opened this issue Oct 3, 2018 · 0 comments
Labels
Domain: JSDoc Relates to JSDoc parsing and type generation Experience Enhancement Noncontroversial enhancements In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

Rather than

/**
 * @typedef Arrayify
 * @type {{ [K in keyof T]: T[K][] }}
 * @template T
 */

/**
 * @typedef Bar
 * @type {{ x: string, y: number }}
 */

/**
 * @type {Arrayify<Bar>}
 */
var x;

I hate writing out the @template tag. Can we just write it out like this?

/**
 * @typedef Arrayify<T>
 * @type {{ [K in keyof T]: T[K][] }}
 */

/**
 * @typedef Bar
 * @type {{ x: string, y: number }}
 */

 /**
  * @type {Arrayify<Bar>}
  */
var x;
@DanielRosenwasser DanielRosenwasser changed the title Specify type parameters instead of @template tags Write type parameters instead of @template tags in JSDoc Oct 3, 2018
@ghost ghost added Suggestion An idea for TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation labels Oct 3, 2018
@RyanCavanaugh RyanCavanaugh added the Experience Enhancement Noncontroversial enhancements label Oct 3, 2018
@weswigham weswigham added the In Discussion Not yet reached consensus label Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: JSDoc Relates to JSDoc parsing and type generation Experience Enhancement Noncontroversial enhancements In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants