From b5c72677fcd1b61e91b8cbfce98face8fa1d7321 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Mon, 29 Sep 2025 11:01:14 +0200 Subject: [PATCH] chore: format codebase --- web/biome.jsonc | 9 +- web/src/app/error.tsx | 11 +- web/src/app/globals.css | 46 ++-- web/src/app/icons/[icon]/opengraph-image.tsx | 4 +- web/src/app/icons/[icon]/page.tsx | 21 +- web/src/app/icons/layout.tsx | 2 +- web/src/app/icons/opengraph-image.tsx | 2 +- web/src/app/icons/page.tsx | 2 +- web/src/app/layout.tsx | 12 +- web/src/app/not-found.tsx | 10 +- web/src/app/sitemap.ts | 2 +- web/src/components/carbon.tsx | 11 +- web/src/components/command-menu.tsx | 12 +- web/src/components/footer.tsx | 2 +- web/src/components/header-nav.tsx | 2 +- web/src/components/header.tsx | 6 +- web/src/components/heart.tsx | 3 +- web/src/components/hero.tsx | 10 +- web/src/components/icon-actions.tsx | 213 ++++++++---------- web/src/components/icon-card.tsx | 14 +- web/src/components/icon-details.tsx | 63 ++---- web/src/components/icon-grid.tsx | 3 +- web/src/components/icon-search.tsx | 15 +- web/src/components/icon-submission-form.tsx | 6 +- web/src/components/license-notice.tsx | 4 +- .../magicui/interactive-hover-button.tsx | 2 +- web/src/components/magicui/marquee.tsx | 2 +- web/src/components/recently-added-icons.tsx | 16 +- web/src/components/theme-switcher.tsx | 3 +- web/src/lib/utils.ts | 2 +- 30 files changed, 220 insertions(+), 290 deletions(-) diff --git a/web/biome.jsonc b/web/biome.jsonc index d8a9893e..b006be2d 100644 --- a/web/biome.jsonc +++ b/web/biome.jsonc @@ -7,10 +7,7 @@ }, "files": { "ignoreUnknown": false, - "includes": [ - "src/**", - "!src/components/ui" - ] + "includes": ["src/**", "!src/components/ui"] }, "formatter": { "lineWidth": 140, @@ -22,6 +19,8 @@ "rules": { "recommended": true, "suspicious": { + "noExplicitAny": "off", + "noUnknownAtRules": "off", "noArrayIndexKey": "off" } } @@ -39,4 +38,4 @@ "quoteStyle": "double" } } -} \ No newline at end of file +} diff --git a/web/src/app/error.tsx b/web/src/app/error.tsx index 817702ae..00c703fc 100644 --- a/web/src/app/error.tsx +++ b/web/src/app/error.tsx @@ -1,18 +1,11 @@ "use client" -import { Button } from "@/components/ui/button" import { AlertTriangle, ArrowLeft, RefreshCcw } from "lucide-react" -import Link from "next/link" import { useRouter } from "next/navigation" import { useEffect } from "react" +import { Button } from "@/components/ui/button" -export default function ErrorPage({ - error, - reset, -}: { - error: Error & { digest?: string } - reset: () => void -}) { +export default function ErrorPage({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) { const router = useRouter() useEffect(() => { diff --git a/web/src/app/globals.css b/web/src/app/globals.css index 7b0f563e..15d912d9 100644 --- a/web/src/app/globals.css +++ b/web/src/app/globals.css @@ -125,20 +125,20 @@ --background: oklch(0.99 0 0); --foreground: oklch(0.32 0 0); - --card: oklch(1.0 0 0); + --card: oklch(1 0 0); --card-foreground: oklch(0.32 0 0); - --popover: oklch(1.0 0 0); + --popover: oklch(1 0 0); --popover-foreground: oklch(0.32 0 0); --primary: oklch(0.67 0.2 23.8); - --primary-foreground: oklch(1.0 0 0); - --secondary: oklch(0.97 0.0 264.54); + --primary-foreground: oklch(1 0 0); + --secondary: oklch(0.97 0 264.54); --secondary-foreground: oklch(0.45 0.03 256.8); - --muted: oklch(0.98 0.0 247.84); + --muted: oklch(0.98 0 247.84); --muted-foreground: oklch(0.55 0.02 264.36); --accent: oklch(0.967 0.001 286.375); --accent-foreground: oklch(0.21 0.006 285.885); --destructive: oklch(0.64 0.21 25.33); - --destructive-foreground: oklch(1.0 0 0); + --destructive-foreground: oklch(1 0 0); --border: oklch(0.9 0.01 247.88); --input: oklch(0.92 0.004 286.32); @@ -159,16 +159,11 @@ --shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.05); --shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.05); - --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px - hsl(0 0% 0% / 0.1); - --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px - hsl(0 0% 0% / 0.1); - --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 2px 4px -1px - hsl(0 0% 0% / 0.1); - --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 4px 6px -1px - hsl(0 0% 0% / 0.1); - --shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 8px 10px -1px - hsl(0 0% 0% / 0.1); + --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px hsl(0 0% 0% / 0.1); + --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px hsl(0 0% 0% / 0.1); + --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 2px 4px -1px hsl(0 0% 0% / 0.1); + --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 4px 6px -1px hsl(0 0% 0% / 0.1); + --shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 8px 10px -1px hsl(0 0% 0% / 0.1); --shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.25); --magic-gradient-color: oklch(0.67 0.2 23.8 / 15%); @@ -182,7 +177,7 @@ --popover: oklch(0.29 0.02 268.4); --popover-foreground: oklch(0.92 0 0); --primary: oklch(0.67 0.2 23.8); - --primary-foreground: oklch(1.0 0 0); + --primary-foreground: oklch(1 0 0); --secondary: oklch(0.31 0.03 266.71); --secondary-foreground: oklch(0.92 0 0); --muted: oklch(0.31 0.03 266.71); @@ -190,7 +185,7 @@ --accent: oklch(0.34 0.06 267.59); --accent-foreground: oklch(0.88 0.06 254.13); --destructive: oklch(0.64 0.21 25.33); - --destructive-foreground: oklch(1.0 0 0); + --destructive-foreground: oklch(1 0 0); --border: oklch(0.38 0.03 269.73); --input: oklch(1 0 0 / 15%); @@ -211,16 +206,11 @@ --shadow-2xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.05); --shadow-xs: 0px 1px 3px 0px hsl(0 0% 0% / 0.05); - --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px - hsl(0 0% 0% / 0.1); - --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px - hsl(0 0% 0% / 0.1); - --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 2px 4px -1px - hsl(0 0% 0% / 0.1); - --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 4px 6px -1px - hsl(0 0% 0% / 0.1); - --shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 8px 10px -1px - hsl(0 0% 0% / 0.1); + --shadow-sm: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px hsl(0 0% 0% / 0.1); + --shadow: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 1px 2px -1px hsl(0 0% 0% / 0.1); + --shadow-md: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 2px 4px -1px hsl(0 0% 0% / 0.1); + --shadow-lg: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 4px 6px -1px hsl(0 0% 0% / 0.1); + --shadow-xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.1), 0px 8px 10px -1px hsl(0 0% 0% / 0.1); --shadow-2xl: 0px 1px 3px 0px hsl(0 0% 0% / 0.25); --magic-gradient-color: oklch(0.27 0 0); diff --git a/web/src/app/icons/[icon]/opengraph-image.tsx b/web/src/app/icons/[icon]/opengraph-image.tsx index 9994f4eb..67157dec 100644 --- a/web/src/app/icons/[icon]/opengraph-image.tsx +++ b/web/src/app/icons/[icon]/opengraph-image.tsx @@ -1,7 +1,7 @@ import { readFile } from "node:fs/promises" import { join } from "node:path" -import { getAllIcons } from "@/lib/api" import { ImageResponse } from "next/og" +import { getAllIcons } from "@/lib/api" export const dynamic = "force-static" @@ -42,7 +42,7 @@ export default async function Image({ params }: { params: { icon: string } }) { const iconPath = join(process.cwd(), `../png/${icon}.png`) console.log(`Generating opengraph image for ${icon} (${index + 1} / ${totalIcons}) from path ${iconPath}`) iconData = await readFile(iconPath) - } catch (error) { + } catch (_error) { console.error(`Icon ${icon} was not found locally`) } diff --git a/web/src/app/icons/[icon]/page.tsx b/web/src/app/icons/[icon]/page.tsx index 230f263b..6f5884fc 100644 --- a/web/src/app/icons/[icon]/page.tsx +++ b/web/src/app/icons/[icon]/page.tsx @@ -1,8 +1,8 @@ +import type { Metadata, ResolvingMetadata } from "next" +import { notFound } from "next/navigation" import { IconDetails } from "@/components/icon-details" import { BASE_URL, WEB_URL } from "@/constants" import { getAllIcons, getAuthorData } from "@/lib/api" -import type { Metadata, ResolvingMetadata } from "next" -import { notFound } from "next/navigation" export const dynamicParams = false export async function generateStaticParams() { @@ -19,7 +19,7 @@ type Props = { searchParams: Promise<{ [key: string]: string | string[] | undefined }> } -export async function generateMetadata({ params, searchParams }: Props, parent: ResolvingMetadata): Promise { +export async function generateMetadata({ params, searchParams }: Props, _parent: ResolvingMetadata): Promise { const { icon } = await params const iconsData = await getAllIcons() if (!iconsData[icon]) { @@ -76,13 +76,14 @@ export async function generateMetadata({ params, searchParams }: Props, parent: type: "website", url: pageUrl, siteName: "Dashboard Icons", - images: [{ - url: `${BASE_URL}/webp/${icon}.webp`, - width: 512, - height: 512, - alt: `${formattedIconName} icon`, - }] - + images: [ + { + url: `${BASE_URL}/webp/${icon}.webp`, + width: 512, + height: 512, + alt: `${formattedIconName} icon`, + }, + ], }, twitter: { card: "summary_large_image", diff --git a/web/src/app/icons/layout.tsx b/web/src/app/icons/layout.tsx index d59fc873..3d7dd7f5 100644 --- a/web/src/app/icons/layout.tsx +++ b/web/src/app/icons/layout.tsx @@ -1,5 +1,5 @@ -import { cn } from "@/lib/utils" import type React from "react" +import { cn } from "@/lib/utils" interface BackgroundWrapperProps { children: React.ReactNode diff --git a/web/src/app/icons/opengraph-image.tsx b/web/src/app/icons/opengraph-image.tsx index 96b34dd7..e29bb7e3 100644 --- a/web/src/app/icons/opengraph-image.tsx +++ b/web/src/app/icons/opengraph-image.tsx @@ -1,5 +1,5 @@ -import { getAllIcons } from "@/lib/api" import { ImageResponse } from "next/og" +import { getAllIcons } from "@/lib/api" export const dynamic = "force-static" diff --git a/web/src/app/icons/page.tsx b/web/src/app/icons/page.tsx index 2fbff9e3..a20e94ef 100644 --- a/web/src/app/icons/page.tsx +++ b/web/src/app/icons/page.tsx @@ -1,7 +1,7 @@ +import type { Metadata } from "next" import { IconSearch } from "@/components/icon-search" import { BASE_URL } from "@/constants" import { getIconsArray } from "@/lib/api" -import type { Metadata } from "next" export async function generateMetadata(): Promise { const icons = await getIconsArray() diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index 877a60c5..b1e93b77 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -1,12 +1,12 @@ -import { PostHogProvider } from "@/components/PostHogProvider" -import { Footer } from "@/components/footer" -import { HeaderWrapper } from "@/components/header-wrapper" -import { LicenseNotice } from "@/components/license-notice" -import { BASE_URL, WEB_URL, getDescription, websiteTitle } from "@/constants" -import { getTotalIcons } from "@/lib/api" import type { Metadata, Viewport } from "next" import { Inter } from "next/font/google" import { Toaster } from "sonner" +import { Footer } from "@/components/footer" +import { HeaderWrapper } from "@/components/header-wrapper" +import { LicenseNotice } from "@/components/license-notice" +import { PostHogProvider } from "@/components/PostHogProvider" +import { BASE_URL, getDescription, WEB_URL, websiteTitle } from "@/constants" +import { getTotalIcons } from "@/lib/api" import "./globals.css" import { ThemeProvider } from "./theme-provider" diff --git a/web/src/app/not-found.tsx b/web/src/app/not-found.tsx index 7eca533f..a7fd77f4 100644 --- a/web/src/app/not-found.tsx +++ b/web/src/app/not-found.tsx @@ -1,13 +1,9 @@ +import { AlertTriangle, ArrowLeft } from "lucide-react" +import Link from "next/link" import { IconSubmissionContent } from "@/components/icon-submission-form" import { Button } from "@/components/ui/button" -import { AlertTriangle, ArrowLeft, PlusCircle } from "lucide-react" -import Link from "next/link" -export default function NotFound({ - error, -}: { - error: Error & { digest?: string } -}) { +export default function NotFound({ error }: { error: Error & { digest?: string } }) { return (
diff --git a/web/src/app/sitemap.ts b/web/src/app/sitemap.ts index 1b7114c3..6c5954ce 100644 --- a/web/src/app/sitemap.ts +++ b/web/src/app/sitemap.ts @@ -1,6 +1,6 @@ +import type { MetadataRoute } from "next" import { BASE_URL, WEB_URL } from "@/constants" import { getAllIcons } from "@/lib/api" -import type { MetadataRoute } from "next" export const dynamic = "force-static" diff --git a/web/src/components/carbon.tsx b/web/src/components/carbon.tsx index 8974959a..4de6a404 100644 --- a/web/src/components/carbon.tsx +++ b/web/src/components/carbon.tsx @@ -1,11 +1,5 @@ import { useEffect, useRef } from "react" export function Carbon() { - // biome-ignore lint/style/noNonNullAssertion: - const ref = useRef(null!) - if (process.env.NODE_ENV === "development") { - return null - } - useEffect(() => { const serve = "CW7IKKQM" const placement = "dashboardiconscom" @@ -16,6 +10,11 @@ export function Carbon() { ref.current.appendChild(s) }, []) + const ref = useRef(null!) + if (process.env.NODE_ENV === "development") { + return null + } + return ( <>