Fix oxlint errors.

This commit is contained in:
Chris Parsons 2026-03-22 20:41:44 -07:00
parent 0139d134cf
commit e4285876ad
4 changed files with 10 additions and 10 deletions

View file

@ -30,7 +30,7 @@ export function PointsDisplay({
<div className="flex flex-col items-end"> <div className="flex flex-col items-end">
<span className="font-semibold">{displayed.toFixed(2)}</span> <span className="font-semibold">{displayed.toFixed(2)}</span>
<span className="text-xs text-muted-foreground"> <span className="text-xs text-muted-foreground">
{projectedPoints!.toFixed(2)} proj {projectedPoints?.toFixed(2)} proj
</span> </span>
</div> </div>
); );

View file

@ -40,10 +40,10 @@ export function useSortableData<T>(
const key = sortConfig.key; const key = sortConfig.key;
const dir = sortConfig.direction; const dir = sortConfig.direction;
return [...data].sort((a, b) => { return data.toSorted((a, b) => {
// Use custom comparator if provided // Use custom comparator if provided
if (comparators?.[key]) { if (comparators?.[key]) {
return comparators[key]!(a, b, dir); return comparators[key]?.(a, b, dir) ?? 0;
} }
const aVal = a[key]; const aVal = a[key];

View file

@ -366,12 +366,12 @@ describe("getUpcomingEventsForDraftedParticipants — bracket sports", () => {
); );
expect(result).toHaveLength(2); expect(result).toHaveLength(2);
const game1 = result.find((r) => r.id === "e1|1")!; const game1 = result.find((r) => r.id === "e1|1");
const game2 = result.find((r) => r.id === "e1|2")!; const game2 = result.find((r) => r.id === "e1|2");
expect(game1.earliestGameTime).toBe(gameTime1.toISOString()); expect(game1?.earliestGameTime).toBe(gameTime1.toISOString());
expect(game1.matchLabel).toBe("Knockout Stage Game #1"); expect(game1?.matchLabel).toBe("Knockout Stage Game #1");
expect(game2.earliestGameTime).toBe(gameTime2.toISOString()); expect(game2?.earliestGameTime).toBe(gameTime2.toISOString());
expect(game2.matchLabel).toBe("Knockout Stage Game #2"); expect(game2?.matchLabel).toBe("Knockout Stage Game #2");
}); });
it("sets matchLabel to round name only (no game number) for single-game matchup", async () => { it("sets matchLabel to round name only (no game number) for single-game matchup", async () => {

View file

@ -51,7 +51,7 @@ export class AflStandingsAdapter implements StandingsSyncAdapter {
// Squiggle already includes `rank` (ladder position), sorted by ladder position. // Squiggle already includes `rank` (ladder position), sorted by ladder position.
// Sort ascending by rank so leagueRank matches the AFL ladder order. // Sort ascending by rank so leagueRank matches the AFL ladder order.
const sorted = [...entries].sort((a, b) => a.rank - b.rank); const sorted = entries.toSorted((a, b) => a.rank - b.rank);
return sorted.map((entry): FetchedStandingsRecord => ({ return sorted.map((entry): FetchedStandingsRecord => ({
teamName: entry.name, teamName: entry.name,