diff --git a/frontend/src/components/forms/FrameRateForm.tsx b/frontend/src/components/forms/FrameRateForm.tsx index 7c57daf28..e58f59c4f 100644 --- a/frontend/src/components/forms/FrameRateForm.tsx +++ b/frontend/src/components/forms/FrameRateForm.tsx @@ -28,11 +28,11 @@ const FrameRateForm: FunctionComponent = ({ selections, onSubmit }) => { }, validate: { from: FormUtils.validation( - (value) => value > 0, + (value: number) => value > 0, "The From value must be larger than 0", ), to: FormUtils.validation( - (value) => value > 0, + (value: number) => value > 0, "The To value must be larger than 0", ), }, diff --git a/frontend/src/components/forms/MovieUploadForm.tsx b/frontend/src/components/forms/MovieUploadForm.tsx index f7f8f47c5..893a33ea5 100644 --- a/frontend/src/components/forms/MovieUploadForm.tsx +++ b/frontend/src/components/forms/MovieUploadForm.tsx @@ -114,10 +114,10 @@ const MovieUploadForm: FunctionComponent = ({ })), }, validate: { - files: FormUtils.validation((values) => { + files: FormUtils.validation((values: SubtitleFile[]) => { return ( values.find( - (v) => + (v: SubtitleFile) => v.language === null || v.validateResult === undefined || v.validateResult.state === "error", diff --git a/frontend/src/components/forms/ProfileEditForm.tsx b/frontend/src/components/forms/ProfileEditForm.tsx index 267951fcb..6f7702d81 100644 --- a/frontend/src/components/forms/ProfileEditForm.tsx +++ b/frontend/src/components/forms/ProfileEditForm.tsx @@ -70,10 +70,10 @@ const ProfileEditForm: FunctionComponent = ({ initialValues: profile, validate: { name: FormUtils.validation( - (value) => value.length > 0, + (value: string) => value.length > 0, "Must have a name", ), - tag: FormUtils.validation((value) => { + tag: FormUtils.validation((value: string | undefined) => { if (!value) { return true; } @@ -81,7 +81,7 @@ const ProfileEditForm: FunctionComponent = ({ return /^[a-z_0-9-]+$/.test(value); }, "Only lowercase alphanumeric characters, underscores (_) and hyphens (-) are allowed"), items: FormUtils.validation( - (value) => value.length > 0, + (value: Language.ProfileItem[]) => value.length > 0, "Must contain at least 1 language", ), }, diff --git a/frontend/src/components/forms/SeriesUploadForm.tsx b/frontend/src/components/forms/SeriesUploadForm.tsx index 9ae6308c9..e09f8e677 100644 --- a/frontend/src/components/forms/SeriesUploadForm.tsx +++ b/frontend/src/components/forms/SeriesUploadForm.tsx @@ -128,9 +128,9 @@ const SeriesUploadForm: FunctionComponent = ({ }, validate: { files: FormUtils.validation( - (values) => + (values: SubtitleFile[]) => values.find( - (v) => + (v: SubtitleFile) => v.language === null || v.episode === null || v.validateResult === undefined || diff --git a/frontend/src/components/forms/TimeOffsetForm.tsx b/frontend/src/components/forms/TimeOffsetForm.tsx index 1a7739dd9..092b99861 100644 --- a/frontend/src/components/forms/TimeOffsetForm.tsx +++ b/frontend/src/components/forms/TimeOffsetForm.tsx @@ -32,11 +32,20 @@ const TimeOffsetForm: FunctionComponent = ({ selections, onSubmit }) => { ms: 0, }, validate: { - hour: FormUtils.validation((v) => v >= 0, "Hour must be larger than 0"), - min: FormUtils.validation((v) => v >= 0, "Minute must be larger than 0"), - sec: FormUtils.validation((v) => v >= 0, "Second must be larger than 0"), + hour: FormUtils.validation( + (v: number) => v >= 0, + "Hour must be larger than 0", + ), + min: FormUtils.validation( + (v: number) => v >= 0, + "Minute must be larger than 0", + ), + sec: FormUtils.validation( + (v: number) => v >= 0, + "Second must be larger than 0", + ), ms: FormUtils.validation( - (v) => v >= 0, + (v: number) => v >= 0, "Millisecond must be larger than 0", ), }, diff --git a/frontend/src/pages/Settings/Notifications/components.tsx b/frontend/src/pages/Settings/Notifications/components.tsx index 8fa17abb2..86151ae2c 100644 --- a/frontend/src/pages/Settings/Notifications/components.tsx +++ b/frontend/src/pages/Settings/Notifications/components.tsx @@ -57,7 +57,7 @@ const NotificationForm: FunctionComponent = ({ "Please select a notification provider", ), url: FormUtils.validation( - (value) => value.trim().length !== 0, + (value: string) => value.trim().length !== 0, "URL must not be empty", ), },