ajv
ajv copied to clipboard
add refs variable for jtd validation
There seems to be some weird behavior with typescript when refs was left to default. By specifying it manually the behavior was fixed.
What issue does this pull request resolve?
fixes #2167
What changes did you make?
- Add
R extends Record<string, unknown>
to compile and validate for JTD schemas that resolves the referenced issue. - Add tests that failed prior to the change
- Added
--cache
to prettier invocation. This is not related to the diff, but a nice quality of life change. I'll remove if requested
Is there anything that requires more attention while reviewing?
- If you're cool with adding
--cache
to prettier -
compile
andvalidate
have really complicated types. This change only resolved the existing tests, but we know coverage is not 100%, so if anything comes to mind that this might hurt.
with or without cache, prettier was tweaking files that broke typescript. I reverted the changes here to get the pull request in, but it's worth calling out