DEV Community

Nicholas Bilyk
Nicholas Bilyk

Posted on

1

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)

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay