feat(ajv): add ajv-formats for ajvResolver#797
feat(ajv): add ajv-formats for ajvResolver#797jorisre merged 2 commits intoreact-hook-form:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds ajv-formats support to the ajvResolver, enabling validation of string formats like email, date, and URI patterns. This addresses issue #796 by providing out-of-the-box format validation capabilities.
Key Changes
- Added ajv-formats dependency to both root package.json and ajv package.json
- Integrated ajv-formats into the ajvResolver by importing and applying the format validators
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Added ajv-formats as a dev dependency in the root package |
| ajv/src/ajv.ts | Imported and applied ajv-formats to the Ajv instance |
| ajv/package.json | Added ajv-formats as a runtime dependency for the ajv resolver package |
Comments suppressed due to low confidence (1)
ajv/package.json:17
- This line shows a removal marker (-) but ajv-errors should remain as a dependency. This appears to be a diff formatting error - the line should not be marked for removal.
"ajv-errors": "^3.0.0",
|
@jorisre can you help me to make this CI / Lint pass? I think the problem is related to different majors of biome. I tried to change biome version to 1.8.3 and run $ bun lint
bunx @biomejs/biome@^1.8.3 check --write --vcs-use-ignore-file=true .
Checked 163 files in 31ms. No fixes applied. |
In the package.json, can you change the
Thanks :) |
Done |
|
🎉 This PR is included in version 5.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
 <h3>Snyk has created this PR to upgrade @hookform/resolvers from 5.1.1 to 5.2.0.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **1 version** ahead of your current version. - The recommended version was released **22 days ago**. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>@hookform/resolvers</b></summary> <ul> <li> <b>5.2.0</b> - <a href="https://redirect.github.com/react-hook-form/resolvers/releases/tag/v5.2.0">2025-07-25</a></br><h1><a href="https://redirect.github.com/react-hook-form/resolvers/compare/v5.1.1...v5.2.0">5.2.0</a> (2025-07-25)</h1> <h3>Features</h3> <ul> <li><strong>ajv:</strong> add ajv-formats for ajvResolver (<a href="https://redirect.github.com/react-hook-form/resolvers/issues/797" data-hovercard-type="pull_request" data-hovercard-url="/react-hook-form/resolvers/pull/797/hovercard">#797</a>) (<a href="https://redirect.github.com/react-hook-form/resolvers/commit/f04003972a3cc7875beb073ff88c942deb6a2086">f040039</a>)</li> </ul> </li> <li> <b>5.1.1</b> - <a href="https://redirect.github.com/react-hook-form/resolvers/releases/tag/v5.1.1">2025-06-09</a></br><h2><a href="https://redirect.github.com/react-hook-form/resolvers/compare/v5.1.0...v5.1.1">5.1.1</a> (2025-06-09)</h2> <h3>Bug Fixes</h3> <ul> <li>zod peer dep issue (<a href="https://redirect.github.com/react-hook-form/resolvers/issues/780" data-hovercard-type="pull_request" data-hovercard-url="/react-hook-form/resolvers/pull/780/hovercard">#780</a>) (<a href="https://redirect.github.com/react-hook-form/resolvers/commit/79cd8b284da29a5a42cd5fdafa2e767747fcfcf7">79cd8b2</a>)</li> </ul> </li> </ul> from <a href="https://redirect.github.com/react-hook-form/resolvers/releases">@hookform/resolvers GitHub release notes</a> </details> </details> --- > [!IMPORTANT] > > - Check the changes in this PR to ensure they won't cause issues with your project. > - This PR was automatically created by Snyk using the credentials of a real user. --- **Note:** _You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs._ **For more information:** <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJhMWRjYjYwNy05YjI0LTQyYTUtYTRhNC1jYjQxMmVlMWFlMDEiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImExZGNiNjA3LTliMjQtNDJhNS1hNGE0LWNiNDEyZWUxYWUwMSJ9fQ==" width="0" height="0"/> > - 🧐 [View latest project report](https://app.snyk.io/org/kagent/project/3a1ab099-8f8f-43a5-81e6-e07ff34c96dc?utm_source=github&utm_medium=referral&page=upgrade-pr) > - 📜 [Customise PR templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template) > - 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/kagent/project/3a1ab099-8f8f-43a5-81e6-e07ff34c96dc/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) > - 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/kagent/project/3a1ab099-8f8f-43a5-81e6-e07ff34c96dc/settings/integration?pkg=@hookform/resolvers&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) [//]: # 'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@hookform/resolvers","from":"5.1.1","to":"5.2.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"a1dcb607-9b24-42a5-a4a4-cb412ee1ae01","prPublicId":"a1dcb607-9b24-42a5-a4a4-cb412ee1ae01","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3a1ab099-8f8f-43a5-81e6-e07ff34c96dc","projectUrl":"https://app.snyk.io/org/kagent/project/3a1ab099-8f8f-43a5-81e6-e07ff34c96dc?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-07-25T12:52:52.510Z"},"vulns":[]}' Co-authored-by: snyk-bot <snyk-bot@snyk.io>
 <h3>Snyk has created this PR to upgrade @hookform/resolvers from 5.1.1 to 5.2.0.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **1 version** ahead of your current version. - The recommended version was released **22 days ago**. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>@hookform/resolvers</b></summary> <ul> <li> <b>5.2.0</b> - <a href="https://redirect.github.com/react-hook-form/resolvers/releases/tag/v5.2.0">2025-07-25</a></br><h1><a href="https://redirect.github.com/react-hook-form/resolvers/compare/v5.1.1...v5.2.0">5.2.0</a> (2025-07-25)</h1> <h3>Features</h3> <ul> <li><strong>ajv:</strong> add ajv-formats for ajvResolver (<a href="https://redirect.github.com/react-hook-form/resolvers/issues/797" data-hovercard-type="pull_request" data-hovercard-url="/react-hook-form/resolvers/pull/797/hovercard">#797</a>) (<a href="https://redirect.github.com/react-hook-form/resolvers/commit/f04003972a3cc7875beb073ff88c942deb6a2086">f040039</a>)</li> </ul> </li> <li> <b>5.1.1</b> - <a href="https://redirect.github.com/react-hook-form/resolvers/releases/tag/v5.1.1">2025-06-09</a></br><h2><a href="https://redirect.github.com/react-hook-form/resolvers/compare/v5.1.0...v5.1.1">5.1.1</a> (2025-06-09)</h2> <h3>Bug Fixes</h3> <ul> <li>zod peer dep issue (<a href="https://redirect.github.com/react-hook-form/resolvers/issues/780" data-hovercard-type="pull_request" data-hovercard-url="/react-hook-form/resolvers/pull/780/hovercard">#780</a>) (<a href="https://redirect.github.com/react-hook-form/resolvers/commit/79cd8b284da29a5a42cd5fdafa2e767747fcfcf7">79cd8b2</a>)</li> </ul> </li> </ul> from <a href="https://redirect.github.com/react-hook-form/resolvers/releases">@hookform/resolvers GitHub release notes</a> </details> </details> --- > [!IMPORTANT] > > - Check the changes in this PR to ensure they won't cause issues with your project. > - This PR was automatically created by Snyk using the credentials of a real user. --- **Note:** _You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs._ **For more information:** <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJhMWRjYjYwNy05YjI0LTQyYTUtYTRhNC1jYjQxMmVlMWFlMDEiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImExZGNiNjA3LTliMjQtNDJhNS1hNGE0LWNiNDEyZWUxYWUwMSJ9fQ==" width="0" height="0"/> > - 🧐 [View latest project report](https://app.snyk.io/org/kagent/project/3a1ab099-8f8f-43a5-81e6-e07ff34c96dc?utm_source=github&utm_medium=referral&page=upgrade-pr) > - 📜 [Customise PR templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=&utm_content=fix-pr-template) > - 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/kagent/project/3a1ab099-8f8f-43a5-81e6-e07ff34c96dc/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) > - 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/kagent/project/3a1ab099-8f8f-43a5-81e6-e07ff34c96dc/settings/integration?pkg=@hookform/resolvers&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) [//]: # 'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"@hookform/resolvers","from":"5.1.1","to":"5.2.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"a1dcb607-9b24-42a5-a4a4-cb412ee1ae01","prPublicId":"a1dcb607-9b24-42a5-a4a4-cb412ee1ae01","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3a1ab099-8f8f-43a5-81e6-e07ff34c96dc","projectUrl":"https://app.snyk.io/org/kagent/project/3a1ab099-8f8f-43a5-81e6-e07ff34c96dc?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2025-07-25T12:52:52.510Z"},"vulns":[]}' Co-authored-by: snyk-bot <snyk-bot@snyk.io>
related to #796