When a class is exported
export class MyClass {
/**
* @param {number} id
*/
constructor(id) {
super(id)
}
}
The constructor will not be documented (the same for any other method defined by a class). This happens in 3.4.2 as well as the 3.5.0-dev version.
With 3.4.2 module is not properly documented. (it display class methods)
/** @module Foobar */
import Something from 'some-thing'
/**
* My foobar class description.
*/
export default class Foobar {
/**
* Create a foobar.
*/
constructor() {
}
}
Expected is in Foobar module page i should get Foobar Class listed only. (currently it list also foobar class methods, ...)
But if i do the following, it work as expected :
/** @module Foobar */
import Something from 'some-thing'
/**
* My foobar class description.
*/
class Foobar {
/**
* Create a foobar.
*/
constructor() {
}
}
export default Foobar
I think I found a workaround for this
@Native-Coder the workaround listed in #1293 does not work for me.
It still require to first write class Foobar {} then add a line export Foobar to be properly documented.
_(it does the work so i am not complaining 馃槃 )_
Tough, i think that it would be a nice enchancement to have the same behaviour if using a single line. i.e.: export default class Foobar {}.
@kslimani It doesn't work as in it's not the way you want to do it, or it doesn't work as in you can't get it to work at all?
It doesn't work the way i expect. (the way i previously described, using single line declaration).
+1 :)
is there any news?
@kslimani 's workaround works for me. Another workaround is to insert the class doc between the export and class keywords:
export
/**
* My foobar class description.
*/
class Foobar {
/**
* Create a foobar.
*/
constructor() {
}
}
Personal preference would to have jsdoc support using export and class a single line, but this at least saves the extra export default Foobar at the end.
Hello all,
For export default class Foo {} I found this module : jsdoc-export-default-interop.
Unfortunatly this does not work for export default function foo() {}.
The fix for #1293 has broken the original example in a new and interesting way. Investigating.
Okay, this is now fixed on master. The fix will be included in JSDoc 3.5.0.
this still doesnt work -
/**
I was suffering similar issues with export default class ... on 3.5.5 recently but interestingly - whilst using jsdoc-export-default-interop - it was only when extending from another class. See my comment in #1132 for info.
@pixi/jsdoc-template has a fix for this. In your configuration:
```json
plugins: [
"@pixi/jsdoc-template/plugins/es6-fix"
]
````
Most helpful comment
this still doesnt work -
/**
*/
export default class ClassB {
....
}