Skip to content

Commit 56a7341

Browse files
committed
chore(lint): cleanup warnings and errors
1 parent 6c84de4 commit 56a7341

11 files changed

Lines changed: 17 additions & 41 deletions

File tree

.eslintignore

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/lib/components/app-sidebar.svelte

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { onMount, type ComponentProps } from 'svelte';
33
import { page } from '$app/state';
44
import { goto } from '$app/navigation';
5+
import { resolve } from '$app/paths';
56
import * as Sidebar from '$lib/components/ui/sidebar/index.ts';
67
import * as Avatar from '$lib/components/ui/avatar/index.ts';
78
import NavUser from '$lib/components/nav-user.svelte';
@@ -50,7 +51,7 @@
5051
extra_channel = result.data;
5152
}
5253
}
53-
goto(`/app/chat/${login}`);
54+
goto(resolve(`/app/chat/${login}`));
5455
}
5556
5657
let authState = new SyncedState<AuthState>('auth_state', {
@@ -68,7 +69,7 @@
6869
async function logout() {
6970
let result = await commands.logout();
7071
if (result.status == 'ok') {
71-
goto('/');
72+
goto(resolve('/'));
7273
} else {
7374
Logger.error('logout failed', result.error);
7475
}
@@ -84,8 +85,6 @@
8485
}
8586
});
8687
87-
$inspect(page.url.pathname);
88-
8988
let {
9089
ref = $bindable(null),
9190
collapsible = 'icon',
@@ -102,7 +101,7 @@
102101
<Sidebar.MenuItem isActive={`/app/chat/${login}` === page.url.pathname}>
103102
<Sidebar.MenuButton size="lg" class="p-2">
104103
{#snippet child({ props })}
105-
<a href={`/app/chat/${login}`} {...props}>
104+
<a href={resolve(`/app/chat/${login}`)} {...props}>
106105
<div class="relative">
107106
<Avatar.Root class="size-8">
108107
<Avatar.Image src={imageUrl} alt={displayName} />

src/lib/components/chat/+badge.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import broadcasterBadge from '$lib/resources/broadcaster.svelte';
66
import vipBadge from '$lib/resources/vip.svelte';
77
import type { BadgeRef } from '$lib/bindings';
8+
import type { Component } from 'svelte';
89
910
interface Props {
1011
badge_ref: BadgeRef;
@@ -16,9 +17,7 @@
1617
badge_ref.set_id !== badge_ref.badge.set_id && badge_ref.id !== badge_ref.badge.id
1718
);
1819
19-
$inspect(badge_ref);
20-
21-
const badgeMap: Map<string, any> = new Map<string, any>([
20+
const badgeMap: Map<string, Component> = new Map<string, Component>([
2221
['subscriber', subBadge],
2322
['moderator', moderatorBadge],
2423
['partner', partnerBadge],

src/lib/components/chat/+badges.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</script>
1111

1212
<span class="inline-flex items-center gap-1 align-middle whitespace-nowrap">
13-
{#each badges as badge}
13+
{#each badges as badge (`${badge.set_id}:${badge.id}`)}
1414
<Badge badge_ref={badge} />
1515
{/each}
1616
</span>

src/lib/components/chat/+emote-picker.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
class="absolute bottom-full left-0 right-0 z-50 max-h-48 overflow-y-auto border rounded-lg bg-popover p-2 shadow-md"
3838
>
3939
{#if showSearch}
40-
<!-- svelte-ignore a11y_autofocus -->
4140
<Input
4241
bind:value={searchQuery}
4342
onkeydown={onSearchKeydown}
@@ -48,7 +47,7 @@
4847
{/if}
4948
{#if emotes.length > 0}
5049
<div class="grid grid-cols-8 gap-1">
51-
{#each emotes as emote, i}
50+
{#each emotes as emote, i (emote.name)}
5251
<Tooltip.Root>
5352
<Tooltip.Trigger>
5453
<button

src/lib/components/ui/button/button.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
</script>
5454

5555
{#if href}
56+
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
5657
<a bind:this={ref} class={cn(buttonVariants({ variant, size }), className)} {href} {...restProps}>
5758
{@render children?.()}
5859
</a>

src/lib/components/ui/sidebar/sidebar-trigger.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</script>
1919

2020
<Button
21+
bind:ref
2122
type="button"
2223
onclick={(e) => {
2324
onclick?.(e);

src/routes/+layout.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<script lang="ts">
22
import { onMount } from 'svelte';
33
import '../app.css';
4-
import { page } from '$app/state';
54
import { checkForAppUpdates } from '$utils/updater';
65
76
let { children } = $props();
87
9-
$inspect(page.params.id);
10-
118
onMount(async () => {
129
await checkForAppUpdates('https://github.com/synthlabs/pepo/releases/latest');
1310
});

src/routes/+page.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { SyncedState } from 'tauri-svelte-synced-store';
44
import { CircleCheckBig, LoaderCircle } from '@lucide/svelte';
55
import { goto } from '$app/navigation';
6+
import { resolve } from '$app/paths';
67
import { commands, type AuthState } from '$lib/bindings';
78
import { cn } from '$lib/utils.js';
89
import Logger from '$utils/log';
@@ -34,7 +35,7 @@
3435
onMount(async () => {
3536
let result = await commands.login(true);
3637
if (result.status == 'ok') {
37-
goto('/app');
38+
goto(resolve('/app'));
3839
}
3940
});
4041
@@ -45,7 +46,7 @@
4546
4647
let result = await commands.login(false);
4748
if (result.status == 'ok') {
48-
goto('/app');
49+
goto(resolve('/app'));
4950
} else {
5051
Logger.error('failure', result.error);
5152
}

src/routes/app/+layout.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
import Users from '@lucide/svelte/icons/users';
1111
import * as Tooltip from '$lib/components/ui/tooltip/index.ts';
1212
import { goto } from '$app/navigation';
13+
import { resolve } from '$app/paths';
1314
1415
let { children } = $props();
1516
1617
let authState = new SyncedState<AuthState>('auth_state');
1718
1819
$effect(() => {
1920
if (authState.ready && authState.obj.phase === 'unauthorized') {
20-
goto('/');
21+
goto(resolve('/'));
2122
}
2223
});
2324

0 commit comments

Comments
 (0)