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:
parent
4480f2e9b6
commit
2c23adb8f2
1 changed files with 1 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue