-
-
Notifications
You must be signed in to change notification settings - Fork 161
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: computed-types resolver #162
Conversation
"birthYear": Object { | ||
"message": "Expect value to be \\"number\\"", | ||
"ref": undefined, | ||
"type": "ValidationError", |
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.
Always the same type, feel free to suggest a better way
path = '', | ||
) => { | ||
return (computedTypesError.errors || []).reduce((acc, error) => { | ||
const _currentPath = String(error.path[0]); |
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.
path is always an array of one item
} from 'react-hook-form'; | ||
|
||
export type Resolver = ( | ||
schema: any, |
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.
Can't find a good way to type the schema.
@kotarella1110 if you want to play with that one, (no worries if you haven't time :))
@@ -4,7 +4,7 @@ import type { | |||
ResolverResult, | |||
UnpackNestedValue, | |||
} from 'react-hook-form'; | |||
import type NopeObject from 'nope-validator/lib/cjs/NopeObject'; | |||
import type { NopeObject } from 'nope-validator/lib/cjs/NopeObject'; |
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.
Nope V1 update
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"prepare": "run-s build:src build && check-export-map", | ||
"prepare": "run-s build:src build && check-export-map && husky install", |
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.
Update to Husky v6
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.
LGTM. Thank you @jorisre
🎉 This PR is included in version 2.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Welcome to the computed-types resolver ! 🎉
Related to #161
👀 :
async
mode for that new resolvercriteriaMode: all
because computed-types returns only the first error of each fieldtype
, alwaysValidationError
:/ errors don't have a property such as a type, code or a key