From acaad4b0bf938aee8725f20c50cabef140570f45 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 5 Feb 2018 16:57:44 -0800 Subject: [PATCH] We fixed formik :D --- .../user/chrome-devtools-frontend.log | 4 +-- tests/baselines/reference/user/formik.log | 28 ------------------- tests/cases/user/formik/index.tsx | 2 +- 3 files changed, 3 insertions(+), 31 deletions(-) delete mode 100644 tests/baselines/reference/user/formik.log diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 11b61110d8d7b..9d4a3b6b748e9 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -12,8 +12,8 @@ Standard output: ../../../../built/local/lib.dom.d.ts(9264,13): error TS2300: Duplicate identifier 'Request'. ../../../../built/local/lib.dom.d.ts(13522,11): error TS2300: Duplicate identifier 'Window'. ../../../../built/local/lib.dom.d.ts(13711,13): error TS2300: Duplicate identifier 'Window'. -../../../../built/local/lib.es5.d.ts(1321,11): error TS2300: Duplicate identifier 'ArrayLike'. -../../../../built/local/lib.es5.d.ts(1350,6): error TS2300: Duplicate identifier 'Record'. +../../../../built/local/lib.es5.d.ts(1328,11): error TS2300: Duplicate identifier 'ArrayLike'. +../../../../built/local/lib.es5.d.ts(1357,6): error TS2300: Duplicate identifier 'Record'. ../../../../node_modules/@types/node/index.d.ts(150,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{ [x: string]: any; }', but here has type 'NodeModule'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(43,8): error TS2339: Property '_importScriptPathPrefix' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(95,28): error TS2339: Property 'response' does not exist on type 'EventTarget'. diff --git a/tests/baselines/reference/user/formik.log b/tests/baselines/reference/user/formik.log deleted file mode 100644 index 52ea18319a2f6..0000000000000 --- a/tests/baselines/reference/user/formik.log +++ /dev/null @@ -1,28 +0,0 @@ -Exit Code: 1 -Standard output: -index.tsx(26,7): error TS2322: Type '{ initialValues: { email: string; password: string; }; validate: (values: Values) => FormikErrors...' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes FormikErrors...' is not assignable to type 'Readonly & { initialValues: { email: string; p...'. - Types of property 'onSubmit' are incompatible. - Type '(values: Values, { setSubmitting, setErrors }: FormikActions) => void' is not assignable to type '((values: { email: string; password: string; }, formikActions: FormikActions<{ email: string; pas...'. - Type '(values: Values, { setSubmitting, setErrors }: FormikActions) => void' is not assignable to type '(values: { email: string; password: string; }, formikActions: FormikActions<{ email: string; pass...'. - Types of parameters 'values' and 'values' are incompatible. - Type '{ email: string; password: string; }' is not assignable to type 'Values'. -index.tsx(32,13): error TS2322: Type '{}' is not assignable to type 'FormikErrors'. - Property 'email' is missing in type '{}'. -index.tsx(33,21): error TS2339: Property 'email' does not exist on type 'Values'. -index.tsx(36,68): error TS2339: Property 'email' does not exist on type 'Values'. -index.tsx(46,22): error TS2345: Argument of type 'Values' is not assignable to parameter of type 'MyData'. -index.tsx(47,11): error TS7006: Parameter 'user' implicitly has an 'any' type. -index.tsx(52,11): error TS7006: Parameter 'errors' implicitly has an 'any' type. -index.tsx(74,27): error TS2339: Property 'email' does not exist on type 'Values'. -index.tsx(76,20): error TS2339: Property 'email' does not exist on type 'FormikTouched'. -index.tsx(76,36): error TS2339: Property 'email' does not exist on type 'FormikErrors'. -index.tsx(76,58): error TS2339: Property 'email' does not exist on type 'FormikErrors'. -index.tsx(82,27): error TS2339: Property 'password' does not exist on type 'Values'. -index.tsx(84,20): error TS2339: Property 'password' does not exist on type 'FormikTouched'. -index.tsx(84,39): error TS2339: Property 'password' does not exist on type 'FormikErrors'. -index.tsx(84,64): error TS2339: Property 'password' does not exist on type 'FormikErrors'. - - - -Standard error: diff --git a/tests/cases/user/formik/index.tsx b/tests/cases/user/formik/index.tsx index 04e06cbd19326..309ed883c5b7c 100644 --- a/tests/cases/user/formik/index.tsx +++ b/tests/cases/user/formik/index.tsx @@ -29,7 +29,7 @@ const Basic = () => ( }} validate={values => { // same as above, but feel free to move this into a class method now. - let errors: FormikErrors = {}; + let errors: FormikErrors = {} as FormikErrors; // FormikErrors isn't optionalized, so in strict null checks this needs a cast if (!values.email) { errors.email = 'Required'; } else if (