From 2c23adb8f2aa4f27be9d02a9af3bd5ccecec00b0 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 7 May 2026 02:35:12 +0000 Subject: [PATCH] Fix lint: replace non-null assertion in FlagSvg with destructure defaults oxlint forbids the ! operator; destructuring with empty-string defaults is equivalent since FlagConfig always has 3 colors. https://claude.ai/code/session_014RUwPfm1qc539xLxW4m9Uy --- app/components/ui/FlagSvg.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/components/ui/FlagSvg.tsx b/app/components/ui/FlagSvg.tsx index 59ad8a9..eafa649 100644 --- a/app/components/ui/FlagSvg.tsx +++ b/app/components/ui/FlagSvg.tsx @@ -8,15 +8,8 @@ interface FlagSvgProps { title?: string; } -function colorAt(colors: string[], index: number): string { - return colors[index % colors.length]!; -} - export function FlagSvg({ config, size = 48, className, title }: FlagSvgProps) { - const colors = config.colors; - const c0 = colorAt(colors, 0); - const c1 = colorAt(colors, 1); - const c2 = colorAt(colors, 2); + const [c0 = "", c1 = "", c2 = ""] = config.colors; return (