Skip to content

Commit

Permalink
feat: Introduce explicit typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
programmiri committed Oct 28, 2022
1 parent 381896b commit b08ea2a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions coral/src/app/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
UseFormProps as _UseFormProps,
UseFormReturn,
} from "react-hook-form";
import { ZodSchema } from "zod";

// ts-jest can't use the import statement for "lodash/get"
// using required makes us able to still use get without
Expand All @@ -46,9 +47,7 @@ type UseFormProps<T extends FieldValues = FieldValues> = Omit<
_UseFormProps<T>,
"resolver"
> & {
//@TODO fix typing
//eslint-disable-next-line @typescript-eslint/no-explicit-any
schema?: any;
schema?: ZodSchema;
};

export const useForm = <T extends FieldValues = FieldValues>({
Expand Down Expand Up @@ -98,9 +97,6 @@ function _TextInput<T extends FieldValues>({
type="text"
{...form.register(name)}
valid={error ? false : undefined}
// @TODO fix typing
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
error={error}
/>
);
Expand Down Expand Up @@ -132,7 +128,6 @@ function _SubmitButton<T extends FieldValues>({

const SubmitButtonMemo = memo(
_SubmitButton,
// @TODO fix typing
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(_prev: FormRegisterProps, _next: FormRegisterProps) => {
return false;
Expand Down

0 comments on commit b08ea2a

Please sign in to comment.