jsdoc
jsdoc copied to clipboard
No automatic default values for arguments in functions exported from ES2015 module.
Input code
/**
* Test function.
* @param {string} [arg] - Test argument.
*/
export function test(arg = 'default_value') {}
JSDoc configuration
Default.
JSDoc debug output
DEBUG: JSDoc 4.0.0 (Thu, 03 Nov 2022 18:37:15 GMT)
DEBUG: Environment info: {"env":{"conf":{"plugins":[],"recurseDepth":10,"source":{"includePattern":".+\\.js(doc|x)?$","excludePattern":"(^|\\/|\\\\)_"},"sourceType":"module","tags":{"allowUnknownTags":true,"dictionaries":["jsdoc","closure"]},"templates":{"monospaceLinks":false,"cleverLinks":false,"default":{"outputSourceFiles":true}}},"opts":{"_":["test.js"],"debug":true,"destination":"./out/","encoding":"utf8"}}}
DEBUG: Parsing source files: ["/mnt/storage/jsdoc_bug/test.js"]
Parsing /mnt/storage/jsdoc_bug/test.js ...
DEBUG: Finished parsing source files.
DEBUG: Adding inherited symbols, mixins, and interface implementations...
DEBUG: Adding borrowed doclets...
DEBUG: Post-processing complete.
Generating output files...
Finished running in 0.81 seconds.
Expected behavior
default column in the generated documentation exists and has values.
Current behavior
No default column in generated documentation at all.
With same code sample, but without export keyword, generated documentation has default column and its values:
/**
* Test function.
* @param {string} [arg] - Test argument.
*/
function test(arg = 'default_value') {}
Your environment
| Software | Version |
|---|---|
| JSDoc | 4.0.0 |
| Node.js | 18.12.1 |
| npm | 8.12.2 |
| Operating system | Debian GNU/Linux bookworm/sid |
+1