修复lint错误

This commit is contained in:
2026-03-20 21:09:26 +08:00
parent ca084cd229
commit 3a172e7731
8 changed files with 13 additions and 22 deletions

4
web/.idea/web.iml generated
View File

@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.svelte-kit" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>

View File

@@ -11,7 +11,7 @@
{@render children()}
<div style="display:none">
{#each locales as locale}
<a href={localizeHref(page.url.pathname, { locale })}>{locale}</a>
{#each locales as locale (locale)}
<a href={resolve(localizeHref(page.url.pathname, { locale }))}>{locale}</a>
{/each}
</div>

View File

@@ -4,7 +4,7 @@ export async function load({ fetch }) {
try {
const albums = await fetchApi('/album', fetch);
return { albums: albums ?? [] };
} catch (error) {
} catch {
return { albums: [] };
}
}

View File

@@ -1,5 +1,5 @@
<script>
import { albums, loading, no_albums } from '$lib/paraglide/messages';
import { albums, no_albums } from '$lib/paraglide/messages';
import { resolve } from '$app/paths';
let { data } = $props();

View File

@@ -34,7 +34,7 @@ export async function load({ params, fetch, url }) {
hasMore,
totalPhotos
};
} catch (error) {
} catch {
return {
album: null,
photos: [],

View File

@@ -2,7 +2,7 @@
import { page } from '$app/state';
import { albums, back, photo_count, loading } from '$lib/paraglide/messages';
import { resolve } from '$app/paths';
import { getPhotoPreviewUrl } from '$lib/api/client';
import { SvelteSet } from 'svelte/reactivity';
let { data } = $props();
@@ -31,7 +31,7 @@
let isLoading = $state(false);
// 已升级质量的图片 ID 集合,避免重复升级
let upgradedPhotoIds = $state(new Set());
let upgradedPhotoIds = new SvelteSet();
// 监听数据变化,重置状态
$effect(() => {
@@ -40,7 +40,7 @@
displayedCount = BATCH_SIZE;
currentPage = 1;
isLoading = false;
upgradedPhotoIds = new Set();
upgradedPhotoIds = new SvelteSet();
}
});

View File

@@ -41,7 +41,7 @@ export async function load({ params, fetch }) {
nextPhotoId = index < photos.length - 1 ? photos[index + 1].id : null;
}
}
} catch (e) {
} catch {
// 静默失败,使用默认值
}
}

View File

@@ -1,7 +1,7 @@
<script>
import { m } from '$lib/paraglide/messages';
import { resolve } from '$app/paths';
import { getPhotoPreviewUrl, getPhotoFileUrl } from '$lib/api/client';
import { getPhotoFileUrl } from '$lib/api/client';
import { goto } from '$app/navigation';
let { data } = $props();
@@ -1292,17 +1292,6 @@
right: 0.5rem;
}
.quality-upgrade-btn,
.network-tip.slow {
bottom: 140px;
padding: 0.5rem 0.875rem;
font-size: 0.8rem;
}
.network-tip.slow button {
font-size: 0.75rem;
}
.shortcut-hints {
display: none;
}