From bd0c7185ab3cf58842aec8ec2b0a033f3949568f Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Sat, 15 Nov 2025 18:29:10 +0100 Subject: [PATCH] linter fixes --- app/sign-up-form.tsx | 5 ++++- components/ui/form.tsx | 8 ++++---- components/ui/label.tsx | 2 +- components/ui/popover.tsx | 2 +- components/ui/select.tsx | 14 +++++++------- lib/signup-time-check.test.ts | 2 +- 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/app/sign-up-form.tsx b/app/sign-up-form.tsx index c84f1d8..1ed4556 100644 --- a/app/sign-up-form.tsx +++ b/app/sign-up-form.tsx @@ -50,6 +50,7 @@ export default function SignUp() { function SignupForm() { return (
+ {/* eslint-disable-next-line @typescript-eslint/no-misused-promises */} diff --git a/components/ui/form.tsx b/components/ui/form.tsx index 84e0f21..608c7f7 100644 --- a/components/ui/form.tsx +++ b/components/ui/form.tsx @@ -39,7 +39,7 @@ const useFormField = () => { const fieldState = getFieldState(fieldContext.name, formState); - if (!fieldContext) { + if (!fieldContext.name) { throw new Error("useFormField should be used within "); } @@ -75,7 +75,7 @@ const FormItem = React.forwardRef, + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => { const { error, formItemId } = useFormField(); @@ -84,7 +84,7 @@ const FormLabel = React.forwardRef< }); FormLabel.displayName = "FormLabel"; -const FormControl = React.forwardRef, React.ComponentPropsWithoutRef>( +const FormControl = React.forwardRef, React.ComponentPropsWithoutRef>( ({ ...props }, ref) => { const { error, formItemId, formDescriptionId, formMessageId } = useFormField(); @@ -113,7 +113,7 @@ FormDescription.displayName = "FormDescription"; const FormMessage = React.forwardRef>( ({ className, children, ...props }, ref) => { const { error, formMessageId } = useFormField(); - const body = error ? String(error?.message) : children; + const body = error ? String(error.message) : children; if (!body) { return null; diff --git a/components/ui/label.tsx b/components/ui/label.tsx index 455af88..cd51d3b 100644 --- a/components/ui/label.tsx +++ b/components/ui/label.tsx @@ -11,7 +11,7 @@ const labelVariants = cva( ); const Label = React.forwardRef< - React.ElementRef, + React.ComponentRef, React.ComponentPropsWithoutRef & VariantProps >(({ className, ...props }, ref) => ( diff --git a/components/ui/popover.tsx b/components/ui/popover.tsx index dc95a2c..001ba7a 100644 --- a/components/ui/popover.tsx +++ b/components/ui/popover.tsx @@ -10,7 +10,7 @@ const Popover = PopoverPrimitive.Root; const PopoverTrigger = PopoverPrimitive.Trigger; const PopoverContent = React.forwardRef< - React.ElementRef, + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, align = "center", sideOffset = 4, ...props }, ref) => ( diff --git a/components/ui/select.tsx b/components/ui/select.tsx index f10957d..58ad355 100644 --- a/components/ui/select.tsx +++ b/components/ui/select.tsx @@ -13,7 +13,7 @@ const SelectGroup = SelectPrimitive.Group; const SelectValue = SelectPrimitive.Value; const SelectTrigger = React.forwardRef< - React.ElementRef, + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( , + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, children, position = "popper", ...props }, ref) => ( @@ -93,7 +93,7 @@ const SelectContent = React.forwardRef< SelectContent.displayName = SelectPrimitive.Content.displayName; const SelectLabel = React.forwardRef< - React.ElementRef, + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( , + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( , + React.ComponentRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => (