How to write jsdoc comments in rescript?

I’m creating an npm package using rescript and I want to add jsdoc comments to the functions to get the Intelli hints for ide and make the user experience better

But I found that the rescript compiler automatically removes the comments, then I checked the documentation and considered:

  1. genType
    can generate types, which is nice, but type hints alone are not enough, I need more detailed and friendly descriptions
  2. %%row
    This is a pain and will make me lose the auto-completion feature of ide

Is there any good solution for this?

1 Like

I also plan to write Tampermonkey Script using rescript. this type of Script needs to include such a comment at the beginning of the js file.

// ==UserScript==
// @name         New Userscript
// @namespace
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://*/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

Apart from my two use cases, there should be other tools that need to make use of comments as well. Is there any good solution for this please?