docgen does not extract type information from prop declared using @Prop(Type)
See original GitHub issueDocgen currently doesn’t extract type information for props declared using @Prop(Type) instead of @Prop({ type: Type }). This usage is advertised in the vue-property-decorator manual and I quite like it.
The problem arises here, where it checks if the @Prop argument is an object
https://github.com/vue-styleguidist/vue-styleguidist/blob/dc9b82a46a336be47b643871ec78b82c2c83adea/packages/vue-docgen-api/src/script-handlers/classPropHandler.ts#L87-L89
There should be an alternative branch added here to handle “bare” type definitions - unfortunately it seems that implementing this requires a bit too much knowledge of the AST for me.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
@motiz88/react-native-docgen - npm
It uses ast-types and @babel/parser to parse the source into an AST and provides methods to process this AST to extract the desired...
Read more >Extracting structured type information | by Atanas Stoyanov
This approach worked fine until trying to extract type information on class-like types that inherit another class-like type located in another file. Trying...
Read more >Typechecking With PropTypes - React
To run typechecking on the props for a component, you can assign the special propTypes property: import PropTypes from 'prop-types'; class Greeting extends ......
Read more >Importing propTypes from external file in React Styleguidist
The problem is the 'Props & Methods' section isn't displayed in the Styleguidist guide when textProps is imported. When I define textProps ...
Read more >vue-styleguidist - Bountysource
Docgen currently doesn't extract type information for props declared using @Prop(Type) instead of @Prop({ type: Type }) . This usage is advertised in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
Thank you!