From 1ffec56bbe0de031468432f9ab83e53c653c6cd0 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Fri, 24 Apr 2026 01:42:30 +0700 Subject: [PATCH] chore(lint): clear website warnings to zero Resolves all 61 oxlint warnings in packages/website/ by hoisting inline callbacks/JSX, extracting sub-components to satisfy jsx-max-depth, using stable data-derived keys, adding explicit button types, flattening nested ternaries, and removing unused code. --- .../website/src/components/command-dialog.tsx | 14 +- .../website/src/components/hero-mockup.tsx | 385 +++++++------- .../website/src/components/landing-page.tsx | 472 ++++++++---------- packages/website/src/routes/download.tsx | 12 +- 4 files changed, 432 insertions(+), 451 deletions(-) diff --git a/packages/website/src/components/command-dialog.tsx b/packages/website/src/components/command-dialog.tsx index 25bb858d9..2a0a66e1f 100644 --- a/packages/website/src/components/command-dialog.tsx +++ b/packages/website/src/components/command-dialog.tsx @@ -46,9 +46,14 @@ export function CommandDialog({ }; }, []); + const handleToggle = React.useCallback(() => setOpen((prev) => !prev), []); + const handleClose = React.useCallback(() => setOpen(false), []); + return (
- + {open && ( <> @@ -58,7 +63,7 @@ export function CommandDialog({ exit={OVERLAY_EXIT} transition={OVERLAY_TRANSITION} className="fixed inset-0 z-40 bg-black/60 backdrop-blur-sm" - onClick={() => setOpen(false)} + onClick={handleClose} /> { navigator.clipboard.writeText(children); setCopied(true); setTimeout(() => setCopied(false), 2000); - } + }, [children]); return (
@@ -97,6 +102,7 @@ function CodeBlock({ children }: { children: string }) { {children}
+ ); +} + function CLISection() { const [activeIndex, setActiveIndex] = React.useState(0); const active = cliExamples[activeIndex]; @@ -1570,17 +1526,13 @@ function CLISection() { >
{cliExamples.map((example, i) => ( - + title={example.title} + index={i} + active={i === activeIndex} + onSelect={setActiveIndex} + /> ))}
diff --git a/packages/website/src/routes/download.tsx b/packages/website/src/routes/download.tsx index d148b0f14..16abaf0ec 100644 --- a/packages/website/src/routes/download.tsx +++ b/packages/website/src/routes/download.tsx @@ -26,6 +26,12 @@ export const Route = createFileRoute("/download")({ component: Download, }); +const homebrewTrigger = ( + + Homebrew + +); + function Download() { const { version } = useRelease(); const urls = downloadUrls(version); @@ -110,11 +116,7 @@ function Download() { - Homebrew - - } + trigger={homebrewTrigger} title="Install via Homebrew" command="brew install --cask paseo" />