Reputation: 42463
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"
}]
Upvotes: 3
Views: 220
Reputation: 2324
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 = {};
Upvotes: 1