DEV Community

Nicholas Bilyk
Nicholas Bilyk

Posted on

Getting JSDoc to work with TypeScript typedef imports.

Alt Text

I've been on a journey to write less esoteric, more accessible code. Before I start writing up my experiences, I'd like to announce a tiny, tiny utility that solves a simple problem I hit when doing plain javascript development.

To document and get type hinting for plain JavaScript, the easiest way to do so is to use a tool called jsdoc. The problem is when you wish to import type definitions /** @typedef ... */ into another file for re-use. VSCode doesn't understand the jsdoc module import format, and jsdoc doesn't understand the typescript style import. My utility works to translate.

For more information, head over to:

https://github.com/polyforest/jsdoc-tsimport-plugin

Top comments (0)