Fix lint errors

This commit is contained in:
Abdo 2025-08-14 09:34:33 +03:00
parent 2e573727ed
commit 9d1ecc3ed9
6 changed files with 22 additions and 11 deletions

View file

@ -41,6 +41,9 @@ module.exports = {
parser: "svelte-eslint-parser", parser: "svelte-eslint-parser",
parserOptions: { parserOptions: {
parser: "@typescript-eslint/parser", parser: "@typescript-eslint/parser",
svelteFeatures: {
experimentalGenerics: true,
},
}, },
rules: { rules: {
"svelte/no-at-html-tags": "off", "svelte/no-at-html-tags": "off",

View file

@ -13,7 +13,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
selectedDeck: DeckNameId | null; selectedDeck: DeckNameId | null;
onChange?: (deck: DeckNameId) => void; onChange?: (deck: DeckNameId) => void;
} }
let {selectedDeck = $bindable(null), onChange}: Props = $props(); let { selectedDeck = $bindable(null), onChange }: Props = $props();
let decks: DeckNameId[] = $state([]); let decks: DeckNameId[] = $state([]);
$effect(() => { $effect(() => {

View file

@ -22,7 +22,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
onChange?: (item: Item) => void; onChange?: (item: Item) => void;
} }
let { title, onChange, icon, items, selectedItem = $bindable(null), keyCombination, tooltip }: Props = $props(); let {
title,
onChange,
icon,
items,
selectedItem = $bindable(null),
keyCombination,
tooltip,
}: Props = $props();
let modal: Modal | null = $state(null); let modal: Modal | null = $state(null);
let searchQuery = $state(""); let searchQuery = $state("");
@ -57,7 +65,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{selectedItem?.name ?? "…"} {selectedItem?.name ?? "…"}
</LabelButton> </LabelButton>
<Shortcut keyCombination={keyCombination} on:action={() => modal?.toggle()} /> <Shortcut {keyCombination} on:action={() => modal?.toggle()} />
<Modal bind:this={modal} dialogClass="modal-lg"> <Modal bind:this={modal} dialogClass="modal-lg">
<div slot="header" class="modal-header"> <div slot="header" class="modal-header">
<IconConstrain iconSize={90}> <IconConstrain iconSize={90}>

View file

@ -14,7 +14,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
selectedNotetype: NotetypeNameId | null; selectedNotetype: NotetypeNameId | null;
onChange?: (notetype: NotetypeNameId) => void; onChange?: (notetype: NotetypeNameId) => void;
} }
let {selectedNotetype = $bindable(null), onChange}: Props = $props(); let { selectedNotetype = $bindable(null), onChange }: Props = $props();
let notetypes: NotetypeNameId[] = $state([]); let notetypes: NotetypeNameId[] = $state([]);
$effect(() => { $effect(() => {

View file

@ -300,14 +300,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let selectedNotetype: NotetypeNameId | null = null; export let selectedNotetype: NotetypeNameId | null = null;
export let selectedDeck: DeckNameId | null = null; export let selectedDeck: DeckNameId | null = null;
function onNotetypeChange(notetype: NotetypeNameId) { function onNotetypeChange(notetype: NotetypeNameId) {
loadNote(0n, notetype.id, 0, null); loadNote(0n, notetype.id, 0, null);
} }
function onDeckChange(deck: DeckNameId) {
selectedDeck = deck;
}
let notetypeMeta: NotetypeIdAndModTime; let notetypeMeta: NotetypeIdAndModTime;
function setNotetypeMeta(notetype: Notetype): void { function setNotetypeMeta(notetype: Notetype): void {
notetypeMeta = { id: notetype.id, modTime: notetype.mtimeSecs }; notetypeMeta = { id: notetype.id, modTime: notetype.mtimeSecs };
@ -1209,7 +1205,7 @@ components and functionality for general note editing.
on:drop={checkNonLegacy(handlePickerDrop)} on:drop={checkNonLegacy(handlePickerDrop)}
> >
{#if mode === "add" && !isLegacy} {#if mode === "add" && !isLegacy}
<EditorChoosers bind:selectedNotetype bind:selectedDeck onNotetypeChange={onNotetypeChange} /> <EditorChoosers bind:selectedNotetype bind:selectedDeck {onNotetypeChange} />
{/if} {/if}
<EditorToolbar {size} {wrap} api={toolbar}> <EditorToolbar {size} {wrap} api={toolbar}>

View file

@ -16,8 +16,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
onNotetypeChange?: (notetype: NotetypeNameId) => void; onNotetypeChange?: (notetype: NotetypeNameId) => void;
onDeckChange?: (deck: DeckNameId) => void; onDeckChange?: (deck: DeckNameId) => void;
} }
let {selectedNotetype = $bindable(null), selectedDeck = $bindable(null), onNotetypeChange, onDeckChange}: Props = $props(); let {
selectedNotetype = $bindable(null),
selectedDeck = $bindable(null),
onNotetypeChange,
onDeckChange,
}: Props = $props();
</script> </script>
<div class="top-bar"> <div class="top-bar">