From 9e3dc043c16e0ff60d2b1b39c2bd01b087e22183 Mon Sep 17 00:00:00 2001 From: casperiv0 <53900565+casperiv0@users.noreply.github.com> Date: Thu, 19 Oct 2023 08:30:04 +0200 Subject: [PATCH] fix: eslint --- .../components/leo/modals/NameSearchModal/speech-alert.tsx | 2 +- apps/client/src/components/modal-buttons/modal-button.tsx | 5 ++++- apps/client/src/components/shared/VersionDisplay.tsx | 2 +- apps/client/src/components/shared/image-wrapper.tsx | 2 +- packages/ui/src/components/fields/date-picker-field.tsx | 2 +- packages/ui/src/components/inputs/checkbox.tsx | 2 +- packages/ui/src/components/inputs/input.tsx | 2 +- packages/ui/src/components/inputs/textarea.tsx | 2 +- packages/ui/src/components/multi-form/multi-form-step.tsx | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/apps/client/src/components/leo/modals/NameSearchModal/speech-alert.tsx b/apps/client/src/components/leo/modals/NameSearchModal/speech-alert.tsx index e4709a2f2..d8ec66978 100644 --- a/apps/client/src/components/leo/modals/NameSearchModal/speech-alert.tsx +++ b/apps/client/src/components/leo/modals/NameSearchModal/speech-alert.tsx @@ -43,5 +43,5 @@ export function SpeechAlert(props: SpeechAlertProps) { speaked.current = true; }, [props]); // eslint-disable-line react-hooks/exhaustive-deps - return props.children as JSX.Element; + return props.children as React.JSX.Element; } diff --git a/apps/client/src/components/modal-buttons/modal-button.tsx b/apps/client/src/components/modal-buttons/modal-button.tsx index 57f3d714e..768012095 100644 --- a/apps/client/src/components/modal-buttons/modal-button.tsx +++ b/apps/client/src/components/modal-buttons/modal-button.tsx @@ -9,7 +9,10 @@ import type { EmsFdDeputy } from "@snailycad/types"; import type { ActiveOfficer } from "state/leo-state"; import { useAuth } from "context/AuthContext"; -type ButtonProps = Pick; +type ButtonProps = Pick< + React.JSX.IntrinsicElements["button"], + "name" | "type" | "title" | "disabled" +>; interface Props extends ButtonProps { button: ModalButton; unit?: ActiveOfficer | EmsFdDeputy | null; diff --git a/apps/client/src/components/shared/VersionDisplay.tsx b/apps/client/src/components/shared/VersionDisplay.tsx index 76d92ee10..5710d775f 100644 --- a/apps/client/src/components/shared/VersionDisplay.tsx +++ b/apps/client/src/components/shared/VersionDisplay.tsx @@ -21,7 +21,7 @@ export function VersionDisplay({ cad }: Props) { ); } -function Link(props: JSX.IntrinsicElements["a"]) { +function Link(props: React.JSX.IntrinsicElements["a"]) { return ( setHasError(true)} />; diff --git a/packages/ui/src/components/fields/date-picker-field.tsx b/packages/ui/src/components/fields/date-picker-field.tsx index aacc898ff..c68da9287 100644 --- a/packages/ui/src/components/fields/date-picker-field.tsx +++ b/packages/ui/src/components/fields/date-picker-field.tsx @@ -80,7 +80,7 @@ export function DatePickerField({ value: _value, ...rest }: Props) { )} > {isMounted ? : null} - {state.validationState === "invalid" && ( + {state.isInvalid && ( )} diff --git a/packages/ui/src/components/inputs/checkbox.tsx b/packages/ui/src/components/inputs/checkbox.tsx index f32d77b05..32c7870d6 100644 --- a/packages/ui/src/components/inputs/checkbox.tsx +++ b/packages/ui/src/components/inputs/checkbox.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { cn } from "mxcn"; -type Props = JSX.IntrinsicElements["input"]; +type Props = React.JSX.IntrinsicElements["input"]; export const Checkbox = React.forwardRef((props, ref) => ( & { +type Props = Omit & { errorMessage?: string | null; }; diff --git a/packages/ui/src/components/inputs/textarea.tsx b/packages/ui/src/components/inputs/textarea.tsx index db94b2a79..bae9d6e7f 100644 --- a/packages/ui/src/components/inputs/textarea.tsx +++ b/packages/ui/src/components/inputs/textarea.tsx @@ -1,7 +1,7 @@ import * as React from "react"; import { cn } from "mxcn"; -type Props = Omit & { +type Props = Omit & { errorMessage?: string | null; }; diff --git a/packages/ui/src/components/multi-form/multi-form-step.tsx b/packages/ui/src/components/multi-form/multi-form-step.tsx index d5dbd9f40..12a435944 100644 --- a/packages/ui/src/components/multi-form/multi-form-step.tsx +++ b/packages/ui/src/components/multi-form/multi-form-step.tsx @@ -4,7 +4,7 @@ export interface MultiFormStepItem { title: string; id: string; isRequired?: boolean; - children(formikState: FormikProps): JSX.Element | null; + children(formikState: FormikProps): React.JSX.Element | null; } export function MultiFormStep(