chore: enable no-array-index-key rule

This commit is contained in:
Julian Sommer
2026-09-15 11:46:06 +10:00
parent 7b27d39fe9
commit 986ca34e34
5 changed files with 5 additions and 0 deletions
@@ -45,6 +45,7 @@ export default defineConfig({
"error",
{ namedComponents: "function-declaration" },
],
"react/no-array-index-key": "error",
"react/jsx-handler-names": "off",
"react/todo": "off",
"react-you-might-not-need-an-effect/no-event-handler": "error",
@@ -127,6 +127,7 @@ export function CliCommandPanel({ commands }: CliCommandPanelProps) {
<pre className="font-mono text-xs/relaxed">
<code>
{cmd.parts.map((part, j) => (
// oxlint-disable-next-line no-array-index-key -- positional tokens of one command, never reordered
<span key={j} className={partStyles[part.type]}>
{part.value}
</span>
@@ -353,6 +353,7 @@ export function CreateLoadBalancerPage() {
</p>
<ul className="mt-1 list-inside list-disc text-xs text-destructive">
{wizardResult.created.map((r, i) => (
// oxlint-disable-next-line no-array-index-key -- static failure summary, never reordered or filtered
<li key={i}>
{r.type}: {r.id ?? "(created)"}
</li>
@@ -162,6 +162,7 @@ function CreateVpc() {
</p>
<ul className="mt-1 list-inside list-disc text-xs text-destructive">
{wizardResult.created.map((r, i) => (
// oxlint-disable-next-line no-array-index-key -- static failure summary, never reordered or filtered
<li key={i}>
{r.type}: {r.id}
</li>
@@ -381,6 +381,7 @@ export function CreateClusterPage() {
<span className="font-mono">0.0.0.0/0</span>.
</p>
{publicCidrs.map((cidr, index) => (
// oxlint-disable-next-line no-array-index-key -- controlled inputs; a stable key needs publicAccessCidrs off string[]
<div className="flex items-center gap-2" key={index}>
<Input
aria-label={`Public access CIDR ${index + 1}`}