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
feat: Support for custom @format
types
#145
Conversation
@format
types@format
types
@format
types@format
types
@format
types@format
types
Very cool, I can't wait to see this PR merge! Good job 👌 |
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## main #145 +/- ##
==========================================
- Coverage 97.32% 97.32% -0.01%
==========================================
Files 14 14
Lines 674 711 +37
Branches 273 283 +10
==========================================
+ Hits 656 692 +36
- Misses 18 19 +1
|
ca28a33
to
bfe655c
Compare
@format
types@format
types
@format
types@format
types
bfe655c
to
ea3732f
Compare
@format
types@format
types
* chore: update eslint * feat: support Record<T, U>
@format
types@format
types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job!!! Thanks for this cool addition! I did modify the code style to fit the rest of the codebase.
This will be part of the next release! (and sorry for the very late review, I'm a totally out of my side-projects thoses days)
See #144.
TL;DR: Added support for more built-in
@format
types, as well as the ability to define custom string validation formats via the config file'scustomJSDocFormats
property:A nice side-effect of this implementation is that custom format types are actually able to override the output of built-ins. For example, one can override the "email" format type like so:
Then as a result, the generated Zod schema for properties with
@format email
will look like:What's left:
date-time
,ip
,ipv4
, &ipv6
.