From 5655931d5bbe4883962b49150b6ab59af77e92c9 Mon Sep 17 00:00:00 2001 From: Riley Abrahamson <32375220+RileyAbr@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:24:09 -0800 Subject: [PATCH] Fix eslint issues --- wally-registry-frontend/.eslintrc.json | 4 +- wally-registry-frontend/next.config.ts | 1 + wally-registry-frontend/src/app/layout.tsx | 5 --- .../[packageScope]/[packageName]/page.tsx | 11 ++--- .../src/components/Header.tsx | 5 ++- .../src/components/Img.tsx | 40 ------------------- .../src/components/PackageTag.tsx | 3 ++ wally-registry-frontend/src/lib/registry.tsx | 14 +------ .../src/services/wally.api.ts | 12 ++++-- 9 files changed, 26 insertions(+), 69 deletions(-) delete mode 100644 wally-registry-frontend/src/components/Img.tsx diff --git a/wally-registry-frontend/.eslintrc.json b/wally-registry-frontend/.eslintrc.json index daa2c20..8227bc1 100644 --- a/wally-registry-frontend/.eslintrc.json +++ b/wally-registry-frontend/.eslintrc.json @@ -3,10 +3,10 @@ "extends": [ "next/core-web-vitals", "next/typescript", - "plugin:jsx-a11y/strict " + "plugin:jsx-a11y/strict" ], "rules": { - "no-constant-condition": ["error", { "checkLoops": "all" }], + "no-constant-condition": ["error", { "checkLoops": true }], "no-unused-vars": 0, "no-console": 2 } diff --git a/wally-registry-frontend/next.config.ts b/wally-registry-frontend/next.config.ts index 02a795f..37ac0e8 100644 --- a/wally-registry-frontend/next.config.ts +++ b/wally-registry-frontend/next.config.ts @@ -2,6 +2,7 @@ import createMDX from "@next/mdx" import type { NextConfig } from "next" const nextConfig: NextConfig = { + output: "export", pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"], compiler: { styledComponents: true, diff --git a/wally-registry-frontend/src/app/layout.tsx b/wally-registry-frontend/src/app/layout.tsx index 626760c..1a7ccf8 100644 --- a/wally-registry-frontend/src/app/layout.tsx +++ b/wally-registry-frontend/src/app/layout.tsx @@ -59,11 +59,6 @@ const iosevka = localFont({ fallback: ["Hack", "Consolas", "monospace"], }) -const iconFont = localFont({ - src: "./fonts/icons.woff2", - display: "block", -}) - export default function RootLayout({ children, }: Readonly<{ diff --git a/wally-registry-frontend/src/app/package/[packageScope]/[packageName]/page.tsx b/wally-registry-frontend/src/app/package/[packageScope]/[packageName]/page.tsx index 4ddb43d..666d895 100644 --- a/wally-registry-frontend/src/app/package/[packageScope]/[packageName]/page.tsx +++ b/wally-registry-frontend/src/app/package/[packageScope]/[packageName]/page.tsx @@ -176,10 +176,10 @@ const MetaItem = ({ } const DependencyLink = ({ packageInfo }: { packageInfo: string }) => { - let packageMatch = packageInfo.match(/(.+\/.+)@[^\d]+([\d.]+)/) + const packageMatch = packageInfo.match(/(.+\/.+)@[^\d]+([\d.]+)/) if (packageMatch != null) { - let name = packageMatch[1] - let version = packageMatch[2] + const name = packageMatch[1] + const version = packageMatch[2] return ( @@ -305,6 +305,7 @@ export default function Package() { useEffect(() => { loadPackageData(packageScope, packageName) + // eslint-disable-next-line react-hooks/exhaustive-deps }, [packageScope, packageName]) if (!isLoaded) { @@ -338,8 +339,8 @@ export default function Package() { {packageName} - Couldn't find {capitalize(packageName)} version {packageVersion}. - Are you sure that's a valid version? + Couldn't find {capitalize(packageName)} version{" "} + {packageVersion}. Are you sure that's a valid version?