DEV Community

Typescript and JSDoc, shared names for Types + Values

Shane Osbourne on September 18, 2023

(written by a human, no AI content) I saw this pattern recently, taking advantage of the fact that Typescript doesn't mind if you re-use the same ...
Collapse
 
artxe2 profile image
Yeom suyun

Personally, I don't like @typedef because they increase the bloat of JSDoc comments, but exporting Type and helper with the same name definitely looks convenient.

Collapse
 
shakyshane profile image
Shane Osbourne

Yep I’m not a big fan of it either - but nice to to know it works if you don’t have the choice πŸ™