diff --git a/.eslintrc.js b/.eslintrc.js index fc64544..21a43e4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,7 +53,6 @@ module.exports = { } }, rules: { - "@typescript-eslint/consistent-type-definitions": ["error", "type"], "@typescript-eslint/consistent-type-imports": [ "error", { prefer: "type-imports", fixStyle: "separate-type-imports" } diff --git a/app/(auth)/layout.tsx b/app/(auth)/layout.tsx index bb96720..2963a0f 100644 --- a/app/(auth)/layout.tsx +++ b/app/(auth)/layout.tsx @@ -5,7 +5,7 @@ import { ThemePickerProvider } from "@/components/theme-picker/theme-picker-prov import type { ReactNode } from "react" -type Props = { +interface Props { children?: ReactNode } diff --git a/app/(legal)/layout.tsx b/app/(legal)/layout.tsx index d3bb830..47473e5 100644 --- a/app/(legal)/layout.tsx +++ b/app/(legal)/layout.tsx @@ -6,7 +6,7 @@ import { Button } from "@/components/ui/button" import type { ReactNode } from "react" -type Props = { +interface Props { children?: ReactNode } diff --git a/app/(marketing)/layout.tsx b/app/(marketing)/layout.tsx index 3626ccc..9e6233c 100644 --- a/app/(marketing)/layout.tsx +++ b/app/(marketing)/layout.tsx @@ -4,7 +4,7 @@ import { Header } from "@/components/layout/header" import type { ReactNode } from "react" -type Props = { +interface Props { children?: ReactNode } diff --git a/app/api/ping/route.ts b/app/api/ping/route.ts index e535157..63b3f1b 100644 --- a/app/api/ping/route.ts +++ b/app/api/ping/route.ts @@ -3,7 +3,7 @@ import { NextResponse } from "next/server" import { env } from "@/env" import { handler } from "@/lib/api-fns" -type ResponseData = { +interface ResponseData { pong: string } diff --git a/app/layout.tsx b/app/layout.tsx index 98c88ba..b841fb2 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -11,7 +11,7 @@ import type { ReactNode } from "react" const inter = Inter({ variable: "--font-inter", subsets: ["latin"] }) -type Props = { +interface Props { children: ReactNode } diff --git a/components/auth/external-auth-button.tsx b/components/auth/external-auth-button.tsx index 2833690..c3fa4ba 100644 --- a/components/auth/external-auth-button.tsx +++ b/components/auth/external-auth-button.tsx @@ -19,7 +19,7 @@ const PROVIDERS = { } } -type Props = { +interface Props { provider: keyof typeof PROVIDERS isLoading?: boolean setIsLoading?: (isLoading: boolean) => void diff --git a/components/layout/header.tsx b/components/layout/header.tsx index 00116f9..fba016a 100644 --- a/components/layout/header.tsx +++ b/components/layout/header.tsx @@ -6,7 +6,7 @@ import { Logo } from "@/components/icons/brand/logo" import { Button } from "@/components/ui/button" import { siteConfig } from "@/config" -type Props = { +interface Props { user?: { id?: string | null } } diff --git a/components/spinner/spinner.tsx b/components/spinner/spinner.tsx index ac5d5a0..be3b1b9 100644 --- a/components/spinner/spinner.tsx +++ b/components/spinner/spinner.tsx @@ -2,7 +2,7 @@ import { cls } from "@/lib/utils" import styles from "./spinner.module.css" -type Props = { +interface Props { className?: string } diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx index fd20708..2ab6e99 100644 --- a/components/ui/badge.tsx +++ b/components/ui/badge.tsx @@ -23,8 +23,9 @@ const badgeVariants = cva( } ) -export type BadgeProps = React.HTMLAttributes & - VariantProps +export interface BadgeProps + extends React.HTMLAttributes, + VariantProps {} function Badge({ className, variant, ...props }: BadgeProps) { return ( diff --git a/components/ui/button.tsx b/components/ui/button.tsx index e48fd26..3bc451a 100644 --- a/components/ui/button.tsx +++ b/components/ui/button.tsx @@ -33,10 +33,11 @@ const buttonVariants = cva( } ) -export type ButtonProps = { +export interface ButtonProps + extends React.ButtonHTMLAttributes, + VariantProps { asChild?: boolean -} & React.ButtonHTMLAttributes & - VariantProps +} const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { diff --git a/components/ui/form.tsx b/components/ui/form.tsx index 6958039..22b8302 100644 --- a/components/ui/form.tsx +++ b/components/ui/form.tsx @@ -10,10 +10,10 @@ import type { ControllerProps, FieldPath, FieldValues } from "react-hook-form" const Form = FormProvider -type FormFieldContextValue< +interface FormFieldContextValue< TFieldValues extends FieldValues = FieldValues, TName extends FieldPath = FieldPath -> = { +> { name: TName } @@ -58,7 +58,7 @@ const useFormField = () => { } } -type FormItemContextValue = { +interface FormItemContextValue { id: string } diff --git a/components/ui/toast.tsx b/components/ui/toast.tsx index e325677..1895c81 100644 --- a/components/ui/toast.tsx +++ b/components/ui/toast.tsx @@ -22,7 +22,6 @@ const ToastViewport = React.forwardRef< )) ToastViewport.displayName = ToastPrimitives.Viewport.displayName -// eslint-disable-next-line tailwindcss/no-custom-classname const toastVariants = cva( "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full", { @@ -30,7 +29,7 @@ const toastVariants = cva( variant: { default: "border bg-background text-foreground", destructive: - "destructive group border-destructive bg-destructive text-destructive-foreground" + "group border-destructive bg-destructive text-destructive-foreground" } }, defaultVariants: { diff --git a/components/ui/use-toast.ts b/components/ui/use-toast.ts index c811a2d..549192e 100644 --- a/components/ui/use-toast.ts +++ b/components/ui/use-toast.ts @@ -47,7 +47,7 @@ type Action = toastId?: ToasterToast["id"] } -type State = { +interface State { toasts: ToasterToast[] } diff --git a/lib/api-fns/types.ts b/lib/api-fns/types.ts index c5e16be..de5c21f 100644 --- a/lib/api-fns/types.ts +++ b/lib/api-fns/types.ts @@ -5,13 +5,13 @@ import type { NextRequest, NextResponse } from "next/server" /** * The API Error response */ -export type ApiResponseError = { +export interface ApiResponseError { ok: false error: string issues?: ZodIssue[] } -export type ApiResponseSuccess = { +export interface ApiResponseSuccess { ok: true data: T } @@ -24,7 +24,7 @@ export type ApiResponse = ApiResponseSuccess | ApiResponseError /** * */ -export type NextRequestContext = { +export interface NextRequestContext { params: T } @@ -34,7 +34,7 @@ export type NextRequestContext = { * * See: https://nextjs.org/docs/app/api-reference/file-conventions/route#context-optional */ -export type NextRouteContext = { +export interface NextRouteContext { params: T }