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
+28 -7
View File
@@ -4,21 +4,42 @@
import { freshStatusTimestamp } from '$lib/server-freshness.js';
import { elapsedSince } from '$ui/duration.js';
import type { GameTelemetry } from '$lib/telemetry.js';
let { name, since = null, report: observation }: { name: string; since?: string | null; report?: GameTelemetry } = $props();
let {
name,
since = null,
report: observation
}: { name: string; since?: string | null; report?: GameTelemetry } = $props();
let report = $derived(observation ?? $telemetryByServer.get(name));
let fresh = $derived(report && freshStatusTimestamp(report.receivedAt, $uiNow)
&& (!since || Date.parse(report.receivedAt) >= Date.parse(since)));
let fresh = $derived(
report &&
freshStatusTimestamp(report.receivedAt, $uiNow) &&
(!since || Date.parse(report.receivedAt) >= Date.parse(since))
);
</script>
{#if report && (report.event === 'round_change' || report.event === 'heartbeat') && fresh}
<div class="round">
<strong>Round {report.round}</strong>
<span title={$timeFormat.dateTime(report.receivedAt)}>Last reported {elapsedSince(report.receivedAt, $uiNow)} ago</span>
<span title={$timeFormat.dateTime(report.receivedAt)}
>Last reported {elapsedSince(report.receivedAt, $uiNow)} ago</span
>
</div>
{/if}
<style>
.round { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
strong { color: var(--text-primary); font-family: var(--font-numeric); font-variant-numeric: tabular-nums; }
span { color: var(--text-tertiary); font-size: var(--text-xs); }
.round {
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: var(--space-2);
}
strong {
color: var(--text-primary);
font-family: var(--font-numeric);
font-variant-numeric: tabular-nums;
}
span {
color: var(--text-tertiary);
font-size: var(--text-xs);
}
</style>