jsdoc
jsdoc copied to clipboard
Add a tag for side effects
I would need to tag when a function has side effects, say with:
@sideEffects: console.log, fs.writefile
Expected behavior
This is supposed to be an array of strings or links to functions documentation within the same code base or externally, or both.
@sideEffects: console.log, fs.writefile
or
@side_effects: console.log, {@link https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback|fs.writefile}
It could be abbreviated as @sfx:
@sfx: console.log, fs.writefile
Related issues:
- probably #833
- @modifies doesn't seem to apply here
Also, having this would also help tracking down if a package has side effects just by searching for @sideEffects and set sideEffects for webpack or moduleSideEffects for rollup accordingly.
Has this been considered? It really would be a key feature for me, as a lot of methods do not return values in React but instead modify the parent class's state
The tag @modifies already exist and is supposed to be used for this situation. But for some reason it has been added in 2018 and has been undocumented ever since