diff --git a/packages/@mantine/form/src/validators/has-length/has-length.ts b/packages/@mantine/form/src/validators/has-length/has-length.ts index db626e43e28..44ecbd92896 100644 --- a/packages/@mantine/form/src/validators/has-length/has-length.ts +++ b/packages/@mantine/form/src/validators/has-length/has-length.ts @@ -27,7 +27,7 @@ function isLengthValid(payload: HasLengthPayload, value: any) { export function hasLength(payload: HasLengthPayload, error?: React.ReactNode) { const _error = error || true; - return (value: unknown) => { + return (value: unknown): React.ReactNode => { if (typeof value === 'string') { return isLengthValid(payload, value.trim()) ? null : _error; } diff --git a/packages/@mantine/form/src/validators/is-in-range/is-in-range.ts b/packages/@mantine/form/src/validators/is-in-range/is-in-range.ts index a831add08db..5a9206af16a 100644 --- a/packages/@mantine/form/src/validators/is-in-range/is-in-range.ts +++ b/packages/@mantine/form/src/validators/is-in-range/is-in-range.ts @@ -6,7 +6,7 @@ interface IsInRangePayload { export function isInRange({ min, max }: IsInRangePayload, error?: React.ReactNode) { const _error = error || true; - return (value: unknown) => { + return (value: unknown): React.ReactNode => { if (typeof value !== 'number') { return _error; } diff --git a/packages/@mantine/form/src/validators/is-not-empty/is-not-empty.ts b/packages/@mantine/form/src/validators/is-not-empty/is-not-empty.ts index f61a7d1cc6f..402a84c4945 100644 --- a/packages/@mantine/form/src/validators/is-not-empty/is-not-empty.ts +++ b/packages/@mantine/form/src/validators/is-not-empty/is-not-empty.ts @@ -1,7 +1,7 @@ export function isNotEmpty(error?: React.ReactNode) { const _error = error || true; - return (value: unknown) => { + return (value: unknown): React.ReactNode => { if (typeof value === 'string') { return value.trim().length > 0 ? null : _error; } diff --git a/packages/@mantine/form/src/validators/matches-field/matches-field.ts b/packages/@mantine/form/src/validators/matches-field/matches-field.ts index 6cf7206ac2d..216a586c5cd 100644 --- a/packages/@mantine/form/src/validators/matches-field/matches-field.ts +++ b/packages/@mantine/form/src/validators/matches-field/matches-field.ts @@ -1,7 +1,7 @@ export function matchesField(field: string, error?: React.ReactNode) { const _error = error || true; - return (value: unknown, values: Record) => { + return (value: unknown, values: Record): React.ReactNode => { if (!values || !(field in values)) { return _error; } diff --git a/packages/@mantine/form/src/validators/matches/matches.ts b/packages/@mantine/form/src/validators/matches/matches.ts index 2b739aabb49..09ce85045d9 100644 --- a/packages/@mantine/form/src/validators/matches/matches.ts +++ b/packages/@mantine/form/src/validators/matches/matches.ts @@ -1,7 +1,7 @@ export function matches(regexp: RegExp, error?: React.ReactNode) { const _error = error || true; - return (value: unknown) => { + return (value: unknown): React.ReactNode => { if (typeof value !== 'string') { return _error; }