🛠️ 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
+10 -14
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import type { Component, Snippet, SvelteComponent } from "svelte";
import type { Component } from "svelte";
import { cn } from "@/utils/cn";
import CopyIcon from "@lucide/svelte/icons/copy";
@@ -18,21 +18,17 @@
let timeoutId: ReturnType<typeof setTimeout> | null = null;
const handleCopy = async () => {
try {
await clipboard(code);
await clipboard(code);
if (timeoutId) {
clearTimeout(timeoutId);
}
copied = true;
timeoutId = setTimeout(() => {
copied = false;
timeoutId = null;
}, copyDuration);
} catch (error) {
copied = false;
if (timeoutId) {
clearTimeout(timeoutId);
}
copied = true;
timeoutId = setTimeout(() => {
copied = false;
timeoutId = null;
}, copyDuration);
};
$effect(() => {
+1 -1
View File
@@ -19,7 +19,7 @@
});
</script>
{#each categories.sort() as category}
{#each categories.sort() as category (category)}
<a
href={`/directory/${category.toLowerCase()}`}
data-sveltekit-preload-data
+1 -1
View File
@@ -27,7 +27,7 @@
{/if}
</Select.Trigger>
<Select.Content sideOffset={1.5}>
{#each Object.entries(managers) as [value, { Icon, label }]}
{#each Object.entries(managers) as [value, { Icon, label }] (value)}
<Select.Item
{value}
onclick={() => pkgManager.set(value as PackageManager)}
@@ -18,7 +18,7 @@
<Dialog.Root>
<Dialog.Trigger>
{@render children?.()}
{@render children()}
</Dialog.Trigger>
<Dialog.Content class="text-sm">
<Dialog.Header>
@@ -33,6 +33,6 @@
</p>
<CodeBlock code={registryCode} />
<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.Root>
+2 -2
View File
@@ -143,7 +143,7 @@
</p>
<div class="flex items-center justify-center space-x-1">
{#if Array.isArray(svgInfo.category)}
{#each svgInfo.category.slice(0, maxVisibleCategories) as c, index}
{#each svgInfo.category.slice(0, maxVisibleCategories) as c (c)}
<a
href={`/directory/${c.toLowerCase()}`}
class={badgeVariants({
@@ -176,7 +176,7 @@
</Popover.Trigger>
<Popover.Content class="flex w-auto flex-col space-y-2">
<p class="font-medium">More tags:</p>
{#each svgInfo.category.slice(maxVisibleCategories) as c}
{#each svgInfo.category.slice(maxVisibleCategories) as c (c)}
<a
href={`/directory/${c.toLowerCase()}`}
class={cn(buttonVariants({ variant: "outline" }), "w-full")}
+1 -1
View File
@@ -3,7 +3,7 @@
HTMLAnchorAttributes,
HTMLButtonAttributes,
} from "svelte/elements";
import { type VariantProps, tv } from "tailwind-variants";
import type { VariantProps } from "tailwind-variants";
import type { WithElementRef } from "@/types/components";
import { cn } from "@/utils/cn";
+1 -1
View File
@@ -105,7 +105,7 @@
</PageHeader>
<Container className="my-6">
<Grid>
{#each displaySvgs as svg}
{#each displaySvgs as svg (svg.id)}
<SvgCard svgInfo={svg} />
{/each}
</Grid>
+2 -2
View File
@@ -27,7 +27,7 @@
// States:
let searchTerm = $state<string>(data.searchTerm || "");
let filteredSvgs = $state<iSVG[]>(data.filteredSvgs);
let filteredSvgs = $derived<iSVG[]>(data.filteredSvgs);
const searchSvgs = () => {
if (!searchTerm) {
@@ -120,7 +120,7 @@
</PageHeader>
<Container className="my-6">
<Grid>
{#each filteredSvgs as svg}
{#each filteredSvgs as svg (svg.id)}
<SvgCard svgInfo={svg} />
{/each}
</Grid>