Upgrade Biome to 2.4.7 and enable 54 additional lint rules

Add rules covering bug prevention (noLeakedRender, noFloatingPromises,
noImportCycles, noReactForwardRef), security (noScriptUrl, noAlert),
performance (noAwaitInLoops, useTopLevelRegex), and code style
(noNestedTernary, useGlobalThis, useNullishCoalescing, useSortedClasses,
plus ~40 more). Fix all violations: extract top-level regex constants,
guard React && renders with boolean coercion, refactor nested ternaries,
replace window with globalThis, sort Tailwind classes, and introduce
expectDomainError test helper to eliminate conditional expects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-14 14:25:09 +01:00
parent 473f1eaefe
commit 36768d3aa1
54 changed files with 428 additions and 441 deletions

View File

@@ -87,17 +87,19 @@ export function CreatePlayerModal({
return (
// biome-ignore lint/a11y/noStaticElementInteractions: backdrop click to close
// biome-ignore lint/a11y/noNoninteractiveElementInteractions: backdrop click to close
<div
className="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
onMouseDown={onClose}
>
{/* biome-ignore lint/a11y/noStaticElementInteractions: prevent close when clicking modal content */}
{/* biome-ignore lint/a11y/noNoninteractiveElementInteractions: prevent close when clicking modal content */}
<div
className="w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-xl"
onMouseDown={(e) => e.stopPropagation()}
>
<div className="mb-4 flex items-center justify-between">
<h2 className="text-lg font-semibold text-foreground">
<h2 className="font-semibold text-foreground text-lg">
{isEdit ? "Edit Player" : "Create Player"}
</h2>
<Button
@@ -112,7 +114,7 @@ export function CreatePlayerModal({
<form onSubmit={handleSubmit} className="flex flex-col gap-4">
<div>
<span className="mb-1 block text-sm text-muted-foreground">
<span className="mb-1 block text-muted-foreground text-sm">
Name
</span>
<Input
@@ -126,12 +128,14 @@ export function CreatePlayerModal({
aria-label="Name"
autoFocus
/>
{error && <p className="mt-1 text-sm text-destructive">{error}</p>}
{!!error && (
<p className="mt-1 text-destructive text-sm">{error}</p>
)}
</div>
<div className="flex gap-3">
<div className="flex-1">
<span className="mb-1 block text-sm text-muted-foreground">
<span className="mb-1 block text-muted-foreground text-sm">
AC
</span>
<Input
@@ -145,7 +149,7 @@ export function CreatePlayerModal({
/>
</div>
<div className="flex-1">
<span className="mb-1 block text-sm text-muted-foreground">
<span className="mb-1 block text-muted-foreground text-sm">
Max HP
</span>
<Input
@@ -161,14 +165,14 @@ export function CreatePlayerModal({
</div>
<div>
<span className="mb-2 block text-sm text-muted-foreground">
<span className="mb-2 block text-muted-foreground text-sm">
Color
</span>
<ColorPalette value={color} onChange={setColor} />
</div>
<div>
<span className="mb-2 block text-sm text-muted-foreground">
<span className="mb-2 block text-muted-foreground text-sm">
Icon
</span>
<IconGrid value={icon} onChange={setIcon} />