chore: update prettier configuration for print width (#519)
* feat: update prettier configuration for print width * chore: apply code formatting to entire repository * fix: remove build files * fix: format issue --------- Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
@@ -2,18 +2,11 @@ import { useForm, zodResolver } from "@mantine/form";
|
||||
|
||||
import { useI18n } from "@homarr/translation/client";
|
||||
import { z } from "@homarr/validation";
|
||||
import type {
|
||||
AnyZodObject,
|
||||
ZodEffects,
|
||||
ZodIntersection,
|
||||
} from "@homarr/validation";
|
||||
import type { AnyZodObject, ZodEffects, ZodIntersection } from "@homarr/validation";
|
||||
import { zodErrorMap } from "@homarr/validation/form";
|
||||
|
||||
export const useZodForm = <
|
||||
TSchema extends
|
||||
| AnyZodObject
|
||||
| ZodEffects<AnyZodObject>
|
||||
| ZodIntersection<AnyZodObject, AnyZodObject>,
|
||||
TSchema extends AnyZodObject | ZodEffects<AnyZodObject> | ZodIntersection<AnyZodObject, AnyZodObject>,
|
||||
>(
|
||||
schema: TSchema,
|
||||
options: Omit<
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import type { TranslationObject } from "@homarr/translation";
|
||||
import type {
|
||||
ErrorMapCtx,
|
||||
z,
|
||||
ZodTooBigIssue,
|
||||
ZodTooSmallIssue,
|
||||
} from "@homarr/validation";
|
||||
import type { ErrorMapCtx, z, ZodTooBigIssue, ZodTooSmallIssue } from "@homarr/validation";
|
||||
import { ZodIssueCode } from "@homarr/validation";
|
||||
|
||||
const handleStringError = (issue: z.ZodInvalidStringIssue) => {
|
||||
@@ -71,10 +66,7 @@ const handleTooBigError = (issue: ZodTooBigIssue) => {
|
||||
} as const;
|
||||
};
|
||||
|
||||
export const handleZodError = (
|
||||
issue: z.ZodIssueOptionalMessage,
|
||||
ctx: ErrorMapCtx,
|
||||
) => {
|
||||
export const handleZodError = (issue: z.ZodIssueOptionalMessage, ctx: ErrorMapCtx) => {
|
||||
if (ctx.defaultError === "Required") {
|
||||
return {
|
||||
key: "errors.required",
|
||||
|
||||
Reference in New Issue
Block a user