Use jsdoc on js with flow type annotations

不想你离开。 提交于 2019-12-05 10:15:49
sami

You could use babel with strip-flow-types transform and use jsdoc-babel.

First, you need to install babel and related packages and jsdoc-babel on top of jsdoc. Then, create a jsdoc-conf.json file in your root directory containing something like this:

{
    "plugins": ["node_modules/jsdoc-babel"],
    "babel": {
        "presets": ["react"],
        "plugins": ["transform-react-jsx", "transform-flow-strip-types"]
    }
}

Usage: jsdoc -c jsdoc-conf.json

You can use any valid babel setup with jsdoc-babel under "babel" that is applied in addition to your .babelrc file. e.g. presets for ES2015 or other babel plugins. Hope this helps!

Just started using documentation.js. Supports JSdoc and flow out of the box.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!