chore: clear the mechanical lint and type findings
Dead imports and locals removed, each blocks keyed, `any` narrowed to unknown. Two context setters kept their calls and lost only the unused binding; the settings redirect no longer awaits a parent whose data it discards. A leading underscore now marks a binding that only holds a position.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
|
||||
import type { Book } from '$lib/schema';
|
||||
import BookThumbnail from './book-thumbnail.svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
import { getBookSelectionState } from '$lib/state/bookSelection.svelte';
|
||||
import { getBookOperationsState } from '$lib/state/bookOperations.svelte';
|
||||
import { getLibraryState } from '$lib/state/library.svelte';
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<script>
|
||||
let { src, fallback = '/images/default_cover.jpg', class: className = '' } = $props();
|
||||
|
||||
async function handleError(e) {
|
||||
e.target.src = fallback;
|
||||
/** @param {Event} e */
|
||||
function handleError(e) {
|
||||
const img = /** @type {HTMLImageElement} */ (e.currentTarget);
|
||||
img.src = fallback;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { resolve } from '$app/paths';
|
||||
import * as Table from '$lib/components/ui/table/index';
|
||||
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index';
|
||||
import * as Tooltip from '$lib/components/ui/tooltip/index';
|
||||
import { Checkbox } from '$lib/components/ui/checkbox/index';
|
||||
import { Badge } from '$lib/components/ui/badge/index';
|
||||
import { buttonVariants } from '$lib/components/ui/button/index.js';
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
import { resolve } from '$app/paths';
|
||||
import BookImage from './book-image.svelte';
|
||||
import GeneratedCover from './generated-cover.svelte';
|
||||
import { Progress } from '$lib/components/ui/progress/index';
|
||||
import { getLibraryState } from '$lib/state/library.svelte';
|
||||
import { getBookSelectionState } from '$lib/state/bookSelection.svelte';
|
||||
import type { Book } from '$lib/schema';
|
||||
|
||||
let { book, class: className = '', ...rest }: { book: Book; class?: string } = $props();
|
||||
let { book, class: className = '' }: { book: Book; class?: string } = $props();
|
||||
|
||||
const selectionState = getBookSelectionState();
|
||||
const libraryState = getLibraryState();
|
||||
@@ -78,7 +77,7 @@
|
||||
|
||||
<!-- Authors list -->
|
||||
<p class="line-clamp-1 w-full text-xs text-muted-foreground">
|
||||
{#each book.authors as author}
|
||||
{#each book.authors as author (author.id)}
|
||||
<a
|
||||
href="{resolve('/(root)/(library)/library/[libraryId]/view', {
|
||||
libraryId: String(libraryState.activeLibrary?.id ?? '')
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<Collapsible.Content class="h-full max-h-128 overflow-y-auto">
|
||||
<Sidebar.GroupContent>
|
||||
<Sidebar.Menu>
|
||||
{#each filter.items as item, index (item.id)}
|
||||
{#each filter.items as item (item.id)}
|
||||
<Sidebar.MenuItem
|
||||
onclick={() => bookCollection.toggleFilter(filter.value, item.id.toString())}
|
||||
>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</DropdownMenu.Trigger>
|
||||
<DropdownMenu.Content class="w-40">
|
||||
<DropdownMenu.Group>
|
||||
{#each bookCollection.sortOptions as sortProp}
|
||||
{#each bookCollection.sortOptions as sortProp (sortProp.value)}
|
||||
<DropdownMenu.Item
|
||||
onSelect={() => bookCollection.updateSort(sortProp.value)}
|
||||
class={bookCollection.orderBy === sortProp.value ? 'bg-muted' : ''}
|
||||
|
||||
Reference in New Issue
Block a user