Given following source code:
/** Comment */
const foo = {};
Generating JSON JSDoc documentation for it:
npx jsdoc -X foo.js
produces expected result:
[{
"description": "Comment",
"name": "foo",
"kind": "constant",
"scope": "global"
}]
But if i place export ES6 keyword in front of the identifier:
/** Comment */
export const foo = {};
the resulting JSON will contain two records for "foo"! One as previous and one "undocumented". Any hints why such strange behavior? Any way to fix it?
[{
"description": "Comment",
"name": "foo",
"kind": "constant",
"scope": "global"
},
{
"undocumented": true,
"name": "foo",
"kind": "constant",
"scope": "global"
}]
According to the JSDoc documentation, you need to include a @module tag when using module exports.
You could do:
/** @module some/module */
/** Comment */
const foo = {};
or simply
/** @module */
/** Comment */
const foo = {};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With