From ab3e044a44da5f541c2ba2b1711d0fc4a7838dda Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Sat, 15 Nov 2025 15:28:19 +0100 Subject: [PATCH] linter fixes --- app/sign-up-form.tsx | 2 +- components/ui/form.tsx | 122 ++++++++++++++------------------------- lib/listmonk.ts | 4 +- lib/signup-time-check.ts | 2 +- 4 files changed, 46 insertions(+), 84 deletions(-) diff --git a/app/sign-up-form.tsx b/app/sign-up-form.tsx index ca0a5b8..c84f1d8 100644 --- a/app/sign-up-form.tsx +++ b/app/sign-up-form.tsx @@ -41,7 +41,7 @@ export default function SignUp() { // Double-check signup isn't blocked before submitting const currentStatus = isSignupBlocked(); if (currentStatus.blocked) { - setResponse(currentStatus.message || "Sign-ups are currently closed."); + setResponse(currentStatus.message ?? "Sign-ups are currently closed."); return; } setSubmitted(true); diff --git a/components/ui/form.tsx b/components/ui/form.tsx index 4a32ae2..84e0f21 100644 --- a/components/ui/form.tsx +++ b/components/ui/form.tsx @@ -3,26 +3,19 @@ import * as React from "react"; import * as LabelPrimitive from "@radix-ui/react-label"; import { Slot } from "@radix-ui/react-slot"; -import { - Controller, - ControllerProps, - FieldPath, - FieldValues, - FormProvider, - useFormContext, -} from "react-hook-form"; +import { Controller, ControllerProps, FieldPath, FieldValues, FormProvider, useFormContext } from "react-hook-form"; import { cn } from "@/lib/utils"; import { Label } from "@/components/ui/label"; const Form = FormProvider; -type FormFieldContextValue< +interface FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, TName extends FieldPath = FieldPath -> = { +> { name: TName; -}; +} const FormFieldContext = React.createContext({} as FormFieldContextValue); @@ -62,9 +55,9 @@ const useFormField = () => { }; }; -type FormItemContextValue = { +interface FormItemContextValue { id: string; -}; +} const FormItemContext = React.createContext({} as FormItemContextValue); @@ -87,83 +80,52 @@ const FormLabel = React.forwardRef< >(({ className, ...props }, ref) => { const { error, formItemId } = useFormField(); - return ( -