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
This commit is contained in:
Claude 2026-05-07 02:35:12 +00:00
parent 4480f2e9b6
commit 2c23adb8f2
No known key found for this signature in database

View file

@ -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 (
<svg