1

I want to migrate lots of JavaScript code which documented with jsduck before. and now I want to migrate them all to jsdoc. It would be great if you help me please. Because I can not find any source for that. So, actually I would also prefer to write a script to do this automatically.

Eva
  • 11
  • 3

1 Answers1

1

I guess first you'll need to familiarize yourself with the JSDoc documentation and understand all the differences of JSDoc v/s JSDuck syntax.

You can export all that JSDuck knows to JSON files using the --export option.

Then you would need to rewrite the doc-comments to express this info using JSDoc syntax. I can suggest tools like recast or jscodeshift to perform modifications of parts of JS code (comments) without changing any other parts of the code.

There might be simpler approaches, like regex search-replace of some @tags. Though it really all depends on the specifics of how your doc-comments are written.

Rene Saarsoo
  • 13,580
  • 8
  • 57
  • 85