Add Prettier and ESLint tooling (Refs #77)

This commit is contained in:
2026-10-09 15:56:13 -04:00
parent 8ed059b8d3
commit 16469e2d43
711 changed files with 99737 additions and 28286 deletions
+6 -3
View File
@@ -12,10 +12,12 @@ export function leaderboardReturnHref(value: string | null | undefined): string
const params = new URLSearchParams();
for (const key of contextKeys) {
const entry = url.searchParams.get(key);
if (entry || key === 'map' && entry !== null) params.set(key, entry!);
if (entry || (key === 'map' && entry !== null)) params.set(key, entry!);
}
return `/leaderboard${params.size ? `?${params}` : ''}`;
} catch { return '/leaderboard'; }
} catch {
return '/leaderboard';
}
}
export function playerContextHref(guid: string, source: string): string {
@@ -31,7 +33,8 @@ export function playerContextHref(guid: string, source: string): string {
if (game === 't5' || game === 't6') params.set('game', game);
if (map !== null && map.length <= 1024) params.set('map', map);
if (players && /^[1-4]$/.test(players)) params.set('players', players);
if (metric && leaderboardMetrics.some(item => item.key === metric)) params.set('metric', metric);
if (metric && leaderboardMetrics.some((item) => item.key === metric))
params.set('metric', metric);
return `/leaderboard/players/${encodeURIComponent(guid)}?${params}`;
}