ts2jsdoc
ts2jsdoc copied to clipboard
Documenting class methods that use arrow functions
For some class methods it can be convenient to define them using arrow functions, which is not currently supported by this parser.
Demo:
class Timer {
private intervalId: number
/**
* @param message - The message to log
*/
tick = (message: string) => {
console.log(message)
if (Math.random() < 0.1) this.stop()
}
start(message: string) {
this.intervalId = setInterval(this.tick, 2000, message)
}
stop() {
clearInterval(this.intervalId)
}
}
With the latest release, the tick method will not be documented as expected. I would expect it to be documented similarly to start and stop.
While I'm here, it would also be nice to have an option to disable the @module at the top of every source file.