From 4f2b8217f819b91ec4b05e32aebd6bc5473db155 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Fri, 27 Mar 2026 18:12:27 +0100 Subject: [PATCH] fix: warnings in code --- apps/nextjs/src/app/[locale]/auth/login/_login-form.tsx | 6 ------ apps/nextjs/src/app/[locale]/auth/login/page.tsx | 2 +- .../src/app/[locale]/boards/(content)/_header-actions.tsx | 1 - .../src/app/[locale]/boards/(content)/_ready-context.tsx | 1 - apps/nextjs/src/app/[locale]/manage/tools/api/page.tsx | 4 ++-- apps/nextjs/src/app/[locale]/manage/tools/logs/page.tsx | 4 ++-- apps/nextjs/src/app/api/health/live/route.ts | 1 - apps/nextjs/src/components/board/items/item-content.tsx | 1 - .../components/board/sections/gridstack/use-gridstack.ts | 1 - packages/spotlight/src/modes/home/context.tsx | 1 - packages/validation/src/redirection-url.ts | 4 ++-- packages/widgets/src/video/component.tsx | 1 - 12 files changed, 7 insertions(+), 20 deletions(-) diff --git a/apps/nextjs/src/app/[locale]/auth/login/_login-form.tsx b/apps/nextjs/src/app/[locale]/auth/login/_login-form.tsx index ef4dc2aeb..71d249cf5 100644 --- a/apps/nextjs/src/app/[locale]/auth/login/_login-form.tsx +++ b/apps/nextjs/src/app/[locale]/auth/login/_login-form.tsx @@ -7,8 +7,6 @@ import { Anchor, Button, Card, Code, Collapse, Divider, PasswordInput, Stack, Te import { useDisclosure } from "@mantine/hooks"; import { z } from "zod/v4"; - - import { signIn } from "@homarr/auth/client"; import { revalidatePathActionAsync } from "@homarr/common/client"; import type { useForm } from "@homarr/form"; @@ -18,10 +16,6 @@ import { useScopedI18n } from "@homarr/translation/client"; import { sanitizeRedirectionUrl } from "@homarr/validation/redirection-url"; import { userSignInSchema } from "@homarr/validation/user"; - - - - type Provider = "credentials" | "ldap" | "oidc"; interface LoginFormProps { diff --git a/apps/nextjs/src/app/[locale]/auth/login/page.tsx b/apps/nextjs/src/app/[locale]/auth/login/page.tsx index 1dca9baaf..22adf3b87 100644 --- a/apps/nextjs/src/app/[locale]/auth/login/page.tsx +++ b/apps/nextjs/src/app/[locale]/auth/login/page.tsx @@ -4,10 +4,10 @@ import { Card, Center, Stack, Text, Title } from "@mantine/core"; import { env } from "@homarr/auth/env"; import { auth } from "@homarr/auth/next"; import { getScopedI18n } from "@homarr/translation/server"; +import { sanitizeRedirectionUrl } from "@homarr/validation/redirection-url"; import { HomarrLogoWithTitle } from "~/components/layout/logo/homarr-logo"; import { LoginForm } from "./_login-form"; -import { sanitizeRedirectionUrl } from "@homarr/validation/redirection-url"; interface LoginProps { searchParams: Promise<{ diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx index ce6866ef3..f1185430c 100644 --- a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx +++ b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx @@ -264,6 +264,5 @@ const usePreventLeaveWithDirty = (isDirty: boolean) => { window.removeEventListener("popstate", handlePopState); window.removeEventListener("beforeunload", handleBeforeUnload); }; - // eslint-disable-next-line react-hooks/exhaustive-deps }, [isDirty]); }; diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_ready-context.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_ready-context.tsx index dcd07a311..606a296ea 100644 --- a/apps/nextjs/src/app/[locale]/boards/(content)/_ready-context.tsx +++ b/apps/nextjs/src/app/[locale]/boards/(content)/_ready-context.tsx @@ -27,7 +27,6 @@ export const BoardReadyProvider = ({ children }: PropsWithChildren) => { useEffect(() => { setReadySections((previous) => previous.filter((id) => board.sections.some((section) => section.id === id))); - // eslint-disable-next-line react-hooks/exhaustive-deps }, [board.sections.length, setReadySections]); const markAsReady = useCallback((id: string) => { diff --git a/apps/nextjs/src/app/[locale]/manage/tools/api/page.tsx b/apps/nextjs/src/app/[locale]/manage/tools/api/page.tsx index adfa1648a..e848c0fcf 100644 --- a/apps/nextjs/src/app/[locale]/manage/tools/api/page.tsx +++ b/apps/nextjs/src/app/[locale]/manage/tools/api/page.tsx @@ -14,7 +14,7 @@ import { ApiKeysManagement } from "./components/api-keys"; export async function generateMetadata() { const session = await auth(); - if (!session?.user || !session.user.permissions.includes("admin")) { + if (!session?.user.permissions.includes("admin")) { return {}; } @@ -27,7 +27,7 @@ export async function generateMetadata() { export default async function ApiPage() { const session = await auth(); - if (!session?.user || !session.user.permissions.includes("admin")) { + if (!session?.user.permissions.includes("admin")) { notFound(); } const document = openApiDocument(extractBaseUrlFromHeaders(await headers())); diff --git a/apps/nextjs/src/app/[locale]/manage/tools/logs/page.tsx b/apps/nextjs/src/app/[locale]/manage/tools/logs/page.tsx index d672947e4..b6901934c 100644 --- a/apps/nextjs/src/app/[locale]/manage/tools/logs/page.tsx +++ b/apps/nextjs/src/app/[locale]/manage/tools/logs/page.tsx @@ -18,7 +18,7 @@ import { LogContextProvider } from "./log-context"; export async function generateMetadata() { const session = await auth(); - if (!session?.user || !session.user.permissions.includes("admin")) { + if (!session?.user.permissions.includes("admin")) { return {}; } const t = await getScopedI18n("management"); @@ -30,7 +30,7 @@ export async function generateMetadata() { export default async function LogsManagementPage() { const session = await auth(); - if (!session?.user || !session.user.permissions.includes("other-view-logs")) { + if (!session?.user.permissions.includes("other-view-logs")) { notFound(); } diff --git a/apps/nextjs/src/app/api/health/live/route.ts b/apps/nextjs/src/app/api/health/live/route.ts index 2576b3f8e..ceeb7dc15 100644 --- a/apps/nextjs/src/app/api/health/live/route.ts +++ b/apps/nextjs/src/app/api/health/live/route.ts @@ -75,7 +75,6 @@ const executeHealthCheckSafelyAsync = async ( }, }; } catch (error) { - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions logger.error(new ErrorWithMetadata("Healthcheck failed", { name }, { cause: error })); return { status: "unhealthy", diff --git a/apps/nextjs/src/components/board/items/item-content.tsx b/apps/nextjs/src/components/board/items/item-content.tsx index 8f89ba091..d61d05902 100644 --- a/apps/nextjs/src/components/board/items/item-content.tsx +++ b/apps/nextjs/src/components/board/items/item-content.tsx @@ -117,7 +117,6 @@ const InnerContent = ({ item, ...dimensions }: InnerContentProps) => { when={ widgetSupportsIntegrations && item.integrationIds.length === 0 && - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition (!("integrationsRequired" in definition) || definition.integrationsRequired !== false) } /> diff --git a/apps/nextjs/src/components/board/sections/gridstack/use-gridstack.ts b/apps/nextjs/src/components/board/sections/gridstack/use-gridstack.ts index 4f2fef067..eda89a8e6 100644 --- a/apps/nextjs/src/components/board/sections/gridstack/use-gridstack.ts +++ b/apps/nextjs/src/components/board/sections/gridstack/use-gridstack.ts @@ -206,7 +206,6 @@ export const useGridstack = (section: Omit, itemIds: string[]) } // Only run this effect when the section items change - // eslint-disable-next-line react-hooks/exhaustive-deps }, [itemIds.length, columnCount]); /** diff --git a/packages/spotlight/src/modes/home/context.tsx b/packages/spotlight/src/modes/home/context.tsx index 3a681499b..fced7fc06 100644 --- a/packages/spotlight/src/modes/home/context.tsx +++ b/packages/spotlight/src/modes/home/context.tsx @@ -94,7 +94,6 @@ const createSpotlightContext = (displayName: string) => { context.unregisterItems(key); }; // We ignore the results - // eslint-disable-next-line react-hooks/exhaustive-deps }, [...dependencyArray, key]); }; diff --git a/packages/validation/src/redirection-url.ts b/packages/validation/src/redirection-url.ts index e9de8af69..3121f6726 100644 --- a/packages/validation/src/redirection-url.ts +++ b/packages/validation/src/redirection-url.ts @@ -9,6 +9,6 @@ export const sanitizeRedirectionUrl = (url?: string) => { if (url && url.startsWith("/") && !url.startsWith("//")) { return url; } else { - return '/'; // Safe default + return "/"; // Safe default } -} \ No newline at end of file +}; diff --git a/packages/widgets/src/video/component.tsx b/packages/widgets/src/video/component.tsx index 68038744e..12b6bbde0 100644 --- a/packages/widgets/src/video/component.tsx +++ b/packages/widgets/src/video/component.tsx @@ -79,7 +79,6 @@ const Feed = ({ options }: Pick, "options">) => { ], }); // All other properties are updated with other useEffect - // eslint-disable-next-line react-hooks/exhaustive-deps }, [videoRef]); useEffect(() => {