Skip to content

Commit

Permalink
fix(yupResolver): yup silently fail (#327) (#320)
Browse files Browse the repository at this point in the history
* chore: update deps

* fix(yupResolver): silently fail

* fix: import format => .mjs
  • Loading branch information
jorisre authored Jan 18, 2022
1 parent e184dbc commit 83f3397
Show file tree
Hide file tree
Showing 10 changed files with 871 additions and 614 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ import { useForm } from 'react-hook-form';
import { yupResolver } from '@hookform/resolvers/yup';
import * as yup from 'yup';

const schema = yup.object().shape({
name: yup.string().required(),
age: yup.number().required(),
}).required();
const schema = yup
.object()
.shape({
name: yup.string().required(),
age: yup.number().required(),
})
.required();

const App = () => {
const { register, handleSubmit } = useForm({
Expand Down
2 changes: 1 addition & 1 deletion class-validator/src/__tests__/Form-native-validation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Schema {
}

interface Props {
onSubmit: SubmitHandler<FormData>;
onSubmit: SubmitHandler<Schema>;
}

function TestComponent({ onSubmit }: Props) {
Expand Down
2 changes: 1 addition & 1 deletion class-validator/src/__tests__/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Schema {
}

interface Props {
onSubmit: SubmitHandler<FormData>;
onSubmit: SubmitHandler<Schema>;
}

function TestComponent({ onSubmit }: Props) {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
restoreMocks: true,
testMatch: ['**/__tests__/**/*.+(js|jsx|ts|tsx)'],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
testPathIgnorePatterns: ['/__fixtures__/'],
testPathIgnorePatterns: ['/__fixtures__/', '/\\.'],
moduleNameMapper: {
'^@hookform/resolvers$': '<rootDir>/src',
},
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,41 +164,41 @@
},
"homepage": "https://react-hook-form.com",
"devDependencies": {
"@testing-library/jest-dom": "^5.15.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.0.2",
"@types/react": "^17.0.33",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"@types/jest": "^27.4.0",
"@types/react": "^17.0.38",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"check-export-map": "^1.2.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.1",
"class-validator": "^0.13.2",
"computed-types": "^1.11.1",
"eslint": "^7.27.0",
"eslint-config-prettier": "^8.3.0",
"fp-ts": "^2.11.5",
"fp-ts": "^2.11.8",
"husky": "^7.0.4",
"io-ts": "^2.0.0",
"io-ts-types": "^0.5.16",
"jest": "^27.3.1",
"joi": "^17.4.2",
"jest": "^27.4.7",
"joi": "^17.5.0",
"lint-staged": "^12.1.7",
"microbundle": "^0.14.1",
"monocle-ts": "^2.3.10",
"newtype-ts": "^0.3.4",
"microbundle": "^0.14.2",
"monocle-ts": "^2.3.12",
"newtype-ts": "^0.3.5",
"nope-validator": "^1.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.2",
"prettier": "^2.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-hook-form": "7.20.4",
"react-hook-form": "7.24.0",
"reflect-metadata": "^0.1.13",
"superstruct": "^0.15.3",
"ts-jest": "^27.0.7",
"ts-jest": "^27.1.3",
"typanion": "^3.7.1",
"typescript": "^4.4.4",
"vest": "^3.2.8",
"typescript": "^4.5.4",
"vest": "^4.0.3",
"yup": "^0.32.11",
"zod": "^3.11.6"
},
Expand Down
Loading

0 comments on commit 83f3397

Please sign in to comment.