Skip to content

Commit 83f3397

Browse files
authored
fix(yupResolver): yup silently fail (#327) (#320)
* chore: update deps * fix(yupResolver): silently fail * fix: import format => .mjs
1 parent e184dbc commit 83f3397

File tree

10 files changed

+871
-614
lines changed

10 files changed

+871
-614
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ import { useForm } from 'react-hook-form';
4747
import { yupResolver } from '@hookform/resolvers/yup';
4848
import * as yup from 'yup';
4949

50-
const schema = yup.object().shape({
51-
name: yup.string().required(),
52-
age: yup.number().required(),
53-
}).required();
50+
const schema = yup
51+
.object()
52+
.shape({
53+
name: yup.string().required(),
54+
age: yup.number().required(),
55+
})
56+
.required();
5457

5558
const App = () => {
5659
const { register, handleSubmit } = useForm({

class-validator/src/__tests__/Form-native-validation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Schema {
1414
}
1515

1616
interface Props {
17-
onSubmit: SubmitHandler<FormData>;
17+
onSubmit: SubmitHandler<Schema>;
1818
}
1919

2020
function TestComponent({ onSubmit }: Props) {

class-validator/src/__tests__/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Schema {
1414
}
1515

1616
interface Props {
17-
onSubmit: SubmitHandler<FormData>;
17+
onSubmit: SubmitHandler<Schema>;
1818
}
1919

2020
function TestComponent({ onSubmit }: Props) {

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
restoreMocks: true,
55
testMatch: ['**/__tests__/**/*.+(js|jsx|ts|tsx)'],
66
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
7-
testPathIgnorePatterns: ['/__fixtures__/'],
7+
testPathIgnorePatterns: ['/__fixtures__/', '/\\.'],
88
moduleNameMapper: {
99
'^@hookform/resolvers$': '<rootDir>/src',
1010
},

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,41 +164,41 @@
164164
},
165165
"homepage": "https://react-hook-form.com",
166166
"devDependencies": {
167-
"@testing-library/jest-dom": "^5.15.0",
167+
"@testing-library/jest-dom": "^5.16.1",
168168
"@testing-library/react": "^12.1.2",
169169
"@testing-library/user-event": "^13.5.0",
170-
"@types/jest": "^27.0.2",
171-
"@types/react": "^17.0.33",
172-
"@typescript-eslint/eslint-plugin": "^5.3.0",
173-
"@typescript-eslint/parser": "^5.3.0",
170+
"@types/jest": "^27.4.0",
171+
"@types/react": "^17.0.38",
172+
"@typescript-eslint/eslint-plugin": "^5.10.0",
173+
"@typescript-eslint/parser": "^5.10.0",
174174
"check-export-map": "^1.2.0",
175175
"class-transformer": "^0.5.1",
176-
"class-validator": "^0.13.1",
176+
"class-validator": "^0.13.2",
177177
"computed-types": "^1.11.1",
178178
"eslint": "^7.27.0",
179179
"eslint-config-prettier": "^8.3.0",
180-
"fp-ts": "^2.11.5",
180+
"fp-ts": "^2.11.8",
181181
"husky": "^7.0.4",
182182
"io-ts": "^2.0.0",
183183
"io-ts-types": "^0.5.16",
184-
"jest": "^27.3.1",
185-
"joi": "^17.4.2",
184+
"jest": "^27.4.7",
185+
"joi": "^17.5.0",
186186
"lint-staged": "^12.1.7",
187-
"microbundle": "^0.14.1",
188-
"monocle-ts": "^2.3.10",
189-
"newtype-ts": "^0.3.4",
187+
"microbundle": "^0.14.2",
188+
"monocle-ts": "^2.3.12",
189+
"newtype-ts": "^0.3.5",
190190
"nope-validator": "^1.0.0",
191191
"npm-run-all": "^4.1.5",
192-
"prettier": "^2.3.2",
192+
"prettier": "^2.5.1",
193193
"react": "^17.0.2",
194194
"react-dom": "^17.0.2",
195-
"react-hook-form": "7.20.4",
195+
"react-hook-form": "7.24.0",
196196
"reflect-metadata": "^0.1.13",
197197
"superstruct": "^0.15.3",
198-
"ts-jest": "^27.0.7",
198+
"ts-jest": "^27.1.3",
199199
"typanion": "^3.7.1",
200-
"typescript": "^4.4.4",
201-
"vest": "^3.2.8",
200+
"typescript": "^4.5.4",
201+
"vest": "^4.0.3",
202202
"yup": "^0.32.11",
203203
"zod": "^3.11.6"
204204
},

0 commit comments

Comments
 (0)