Add oxlint for type-aware linting that Biome cannot cover

Install oxlint with tsgolint for TypeScript type information. Enable
rules for unnecessary type assertions, deprecated API usage, preferring
replaceAll over replace with global regex, and String.raw for escaped
backslashes. Fix all violations: remove redundant as-casts, replace
deprecated FormEvent with SubmitEvent, convert replace(/g) to
replaceAll, and use String.raw in escapeRegExp. Add oxlint to the
pnpm check gate alongside Biome.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-14 14:41:30 +01:00
parent 36768d3aa1
commit c94c30e459
12 changed files with 345 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
import type { PlayerCharacter, PlayerIcon } from "@initiative/domain";
import type { PlayerCharacter } from "@initiative/domain";
import {
Check,
Eye,
@@ -9,12 +9,7 @@ import {
Plus,
Users,
} from "lucide-react";
import {
type FormEvent,
type RefObject,
useDeferredValue,
useState,
} from "react";
import { type RefObject, useDeferredValue, useState } from "react";
import type { SearchResult } from "../hooks/use-bestiary.js";
import { cn } from "../lib/utils.js";
import { D20Icon } from "./d20-icon.js";
@@ -103,11 +98,9 @@ function AddModeSuggestions({
</div>
<ul>
{pcMatches.map((pc) => {
const PcIcon = pc.icon
? PLAYER_ICON_MAP[pc.icon as PlayerIcon]
: undefined;
const PcIcon = pc.icon ? PLAYER_ICON_MAP[pc.icon] : undefined;
const pcColor = pc.color
? PLAYER_COLOR_HEX[pc.color as keyof typeof PLAYER_COLOR_HEX]
? PLAYER_COLOR_HEX[pc.color]
: undefined;
return (
<li key={pc.id}>
@@ -318,7 +311,7 @@ export function ActionBar({
return Number.isNaN(n) ? undefined : n;
};
const handleAdd = (e: FormEvent) => {
const handleAdd = (e: React.SubmitEvent<HTMLFormElement>) => {
e.preventDefault();
if (browseMode) return;
if (queued) {