chore: setup linting

This commit is contained in:
Max Richter
2026-02-02 16:22:14 +01:00
parent 137425b31b
commit 30e897468a
174 changed files with 6043 additions and 5107 deletions

View File

@@ -1,19 +1,19 @@
<script lang="ts">
import { humanizeDuration, humanizeNumber } from "$lib/helpers";
import { localState } from "$lib/helpers/localState.svelte";
import SmallGraph from "./SmallGraph.svelte";
import type { PerformanceData, PerformanceStore } from "@nodarium/utils";
import { humanizeDuration, humanizeNumber } from '$lib/helpers';
import { localState } from '$lib/helpers/localState.svelte';
import type { PerformanceData, PerformanceStore } from '@nodarium/utils';
import SmallGraph from './SmallGraph.svelte';
const { store, fps }: { store: PerformanceStore; fps: number[] } = $props();
const open = localState("node.performance.small.open", {
const open = localState('node.performance.small.open', {
runtime: false,
fps: false,
fps: false
});
const vertices = $derived($store?.at(-1)?.["total-vertices"]?.[0] || 0);
const faces = $derived($store?.at(-1)?.["total-faces"]?.[0] || 0);
const runtime = $derived($store?.at(-1)?.["runtime"]?.[0] || 0);
const vertices = $derived($store?.at(-1)?.['total-vertices']?.[0] || 0);
const faces = $derived($store?.at(-1)?.['total-faces']?.[0] || 0);
const runtime = $derived($store?.at(-1)?.['runtime']?.[0] || 0);
function getPoints(data: PerformanceData, key: string) {
return data?.map((run) => run[key]?.[0] || 0) || [];
@@ -24,25 +24,25 @@
<table>
<tbody>
<tr
style="cursor:pointer;"
style="cursor: pointer"
onclick={() => (open.value.runtime = !open.value.runtime)}
>
<td>{open.value.runtime ? "-" : "+"} runtime </td>
<td>{open.value.runtime ? '-' : '+'} runtime</td>
<td>{humanizeDuration(runtime || 1000)}</td>
</tr>
{#if open.value.runtime}
<tr>
<td colspan="2">
<SmallGraph points={getPoints($store, "runtime")} />
<SmallGraph points={getPoints($store, 'runtime')} />
</td>
</tr>
{/if}
<tr
style="cursor:pointer;"
style="cursor: pointer"
onclick={() => (open.value.fps = !open.value.fps)}
>
<td>{open.value.fps ? "-" : "+"} fps </td>
<td>{open.value.fps ? '-' : '+'} fps</td>
<td>
{Math.floor(fps[fps.length - 1])}fps
</td>
@@ -56,12 +56,12 @@
{/if}
<tr>
<td>vertices </td>
<td>vertices</td>
<td>{humanizeNumber(vertices || 0)}</td>
</tr>
<tr>
<td>faces </td>
<td>faces</td>
<td>{humanizeNumber(faces || 0)}</td>
</tr>
</tbody>