🛠️ Fixed eslint errors

This commit is contained in:
pheralb
2025-08-31 14:25:57 +01:00
parent a488bd4c7a
commit 5df7a336ba
8 changed files with 20 additions and 24 deletions
+1 -5
View File
@@ -1,5 +1,5 @@
<script lang="ts"> <script lang="ts">
import type { Component, Snippet, SvelteComponent } from "svelte"; import type { Component } from "svelte";
import { cn } from "@/utils/cn"; import { cn } from "@/utils/cn";
import CopyIcon from "@lucide/svelte/icons/copy"; import CopyIcon from "@lucide/svelte/icons/copy";
@@ -18,7 +18,6 @@
let timeoutId: ReturnType<typeof setTimeout> | null = null; let timeoutId: ReturnType<typeof setTimeout> | null = null;
const handleCopy = async () => { const handleCopy = async () => {
try {
await clipboard(code); await clipboard(code);
if (timeoutId) { if (timeoutId) {
@@ -30,9 +29,6 @@
copied = false; copied = false;
timeoutId = null; timeoutId = null;
}, copyDuration); }, copyDuration);
} catch (error) {
copied = false;
}
}; };
$effect(() => { $effect(() => {
+1 -1
View File
@@ -19,7 +19,7 @@
}); });
</script> </script>
{#each categories.sort() as category} {#each categories.sort() as category (category)}
<a <a
href={`/directory/${category.toLowerCase()}`} href={`/directory/${category.toLowerCase()}`}
data-sveltekit-preload-data data-sveltekit-preload-data
+1 -1
View File
@@ -27,7 +27,7 @@
{/if} {/if}
</Select.Trigger> </Select.Trigger>
<Select.Content sideOffset={1.5}> <Select.Content sideOffset={1.5}>
{#each Object.entries(managers) as [value, { Icon, label }]} {#each Object.entries(managers) as [value, { Icon, label }] (value)}
<Select.Item <Select.Item
{value} {value}
onclick={() => pkgManager.set(value as PackageManager)} onclick={() => pkgManager.set(value as PackageManager)}
@@ -18,7 +18,7 @@
<Dialog.Root> <Dialog.Root>
<Dialog.Trigger> <Dialog.Trigger>
{@render children?.()} {@render children()}
</Dialog.Trigger> </Dialog.Trigger>
<Dialog.Content class="text-sm"> <Dialog.Content class="text-sm">
<Dialog.Header> <Dialog.Header>
@@ -33,6 +33,6 @@
</p> </p>
<CodeBlock code={registryCode} /> <CodeBlock code={registryCode} />
<p class="mt-2">2. Then use the following command to add SVGs:</p> <p class="mt-2">2. Then use the following command to add SVGs:</p>
<CodeBlock code={`npx shadcn@latest add @svgl/[svg-name]`} /> <CodeBlock code="npx shadcn@latest add @svgl/[svg-name]" />
</Dialog.Content> </Dialog.Content>
</Dialog.Root> </Dialog.Root>
+2 -2
View File
@@ -143,7 +143,7 @@
</p> </p>
<div class="flex items-center justify-center space-x-1"> <div class="flex items-center justify-center space-x-1">
{#if Array.isArray(svgInfo.category)} {#if Array.isArray(svgInfo.category)}
{#each svgInfo.category.slice(0, maxVisibleCategories) as c, index} {#each svgInfo.category.slice(0, maxVisibleCategories) as c (c)}
<a <a
href={`/directory/${c.toLowerCase()}`} href={`/directory/${c.toLowerCase()}`}
class={badgeVariants({ class={badgeVariants({
@@ -176,7 +176,7 @@
</Popover.Trigger> </Popover.Trigger>
<Popover.Content class="flex w-auto flex-col space-y-2"> <Popover.Content class="flex w-auto flex-col space-y-2">
<p class="font-medium">More tags:</p> <p class="font-medium">More tags:</p>
{#each svgInfo.category.slice(maxVisibleCategories) as c} {#each svgInfo.category.slice(maxVisibleCategories) as c (c)}
<a <a
href={`/directory/${c.toLowerCase()}`} href={`/directory/${c.toLowerCase()}`}
class={cn(buttonVariants({ variant: "outline" }), "w-full")} class={cn(buttonVariants({ variant: "outline" }), "w-full")}
+1 -1
View File
@@ -3,7 +3,7 @@
HTMLAnchorAttributes, HTMLAnchorAttributes,
HTMLButtonAttributes, HTMLButtonAttributes,
} from "svelte/elements"; } from "svelte/elements";
import { type VariantProps, tv } from "tailwind-variants"; import type { VariantProps } from "tailwind-variants";
import type { WithElementRef } from "@/types/components"; import type { WithElementRef } from "@/types/components";
import { cn } from "@/utils/cn"; import { cn } from "@/utils/cn";
+1 -1
View File
@@ -105,7 +105,7 @@
</PageHeader> </PageHeader>
<Container className="my-6"> <Container className="my-6">
<Grid> <Grid>
{#each displaySvgs as svg} {#each displaySvgs as svg (svg.id)}
<SvgCard svgInfo={svg} /> <SvgCard svgInfo={svg} />
{/each} {/each}
</Grid> </Grid>
+2 -2
View File
@@ -27,7 +27,7 @@
// States: // States:
let searchTerm = $state<string>(data.searchTerm || ""); let searchTerm = $state<string>(data.searchTerm || "");
let filteredSvgs = $state<iSVG[]>(data.filteredSvgs); let filteredSvgs = $derived<iSVG[]>(data.filteredSvgs);
const searchSvgs = () => { const searchSvgs = () => {
if (!searchTerm) { if (!searchTerm) {
@@ -120,7 +120,7 @@
</PageHeader> </PageHeader>
<Container className="my-6"> <Container className="my-6">
<Grid> <Grid>
{#each filteredSvgs as svg} {#each filteredSvgs as svg (svg.id)}
<SvgCard svgInfo={svg} /> <SvgCard svgInfo={svg} />
{/each} {/each}
</Grid> </Grid>