react-docgen-typescript
react-docgen-typescript copied to clipboard
Add support for @defaultValue TSDoc tag
This adds support for the @defaultValue
tag from the TSDoc specification. The existence of both specs can be pretty confusing because there's quite a bit of overlap, but I think ultimately what we're writing in .ts
files is TSDoc as it doesn't include the type information like JSDoc does. I kept support for the @default tag both for backward compatibility and because TypeScript does support actual JSDoc in .js
files, though I'm not sure whether this tool actually does support that case.
For reference:
- https://tsdoc.org/pages/tags/defaultvalue/
- https://github.com/microsoft/tsdoc/issues/27
- https://jsdoc.app/tags-default.html
I'm happy to address any feedback and thanks for this wonderful tool!
It may also be worth considering the use case identified in https://github.com/styleguidist/react-docgen-typescript/issues/457, though I think we'd probably want to add an option like preferDefaultTag
to optionally force @default
and @defaultValue
to take precedence over the default assignment in a component.
What's the status of this PR?
Thank you for your response :)
Hey @BAISTM, I think this project may be a little stalled out. At this point, a fork may be our best option. I don't have an acute need for this at the moment, but if I return to the work that prompted this PR, I may get a fork going and release something from there. In which case, I'll let you know here.
Hi guys, @jrolfs you are right. I tried to open a discussion about it here #494.
@jrolfs Thank you for your response, I already did a work-around in my project. The fork can be a good solution if someone can ensure it's maintainability.