ajv icon indicating copy to clipboard operation
ajv copied to clipboard

add refs variable for jtd validation

Open erikbrinkman opened this issue 1 year ago • 1 comments

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?

  1. If you're cool with adding --cache to prettier
  2. compile and validate 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

erikbrinkman avatar Jul 29 '23 17:07 erikbrinkman