Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include JSDoc comments on Zod schemas in type definitions #7

Closed
coreyward opened this issue Aug 18, 2024 · 2 comments
Closed

Include JSDoc comments on Zod schemas in type definitions #7

coreyward opened this issue Aug 18, 2024 · 2 comments

Comments

@coreyward
Copy link

I pretty regularly define Zod schemas with inline JSDoc comments. VSCode/IntelliSense picks these up and includes them when showing types on hover, even for the inferred types:

Screenshot 2024-08-18 at 11 36 30 AM Screenshot 2024-08-18 at 11 36 22 AM Screenshot 2024-08-18 at 11 36 11 AM

TypeDoc with this plugin, however, only shows the comment for the object schema type on the Zod schema variable, not on the type definition:

Screenshot 2024-08-18 at 11 38 31 AM Screenshot 2024-08-18 at 11 38 46 AM

It would be great to have the JSDoc entry copied over into the type definition as well, so that the "Some example documentation" line shows on the Type Alias page shown in the first TypeDoc screenshot.

Is this possible?

@Gerrit0
Copy link
Owner

Gerrit0 commented Aug 18, 2024

Yes, possible and pretty easy too!

@coreyward
Copy link
Author

Wow, that was fast! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants