mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Fix lint errors
This commit is contained in:
parent
2e573727ed
commit
9d1ecc3ed9
6 changed files with 22 additions and 11 deletions
|
@ -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",
|
||||||
|
|
|
@ -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(() => {
|
||||||
|
|
|
@ -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}>
|
||||||
|
|
|
@ -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(() => {
|
||||||
|
|
|
@ -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}>
|
||||||
|
|
|
@ -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">
|
||||||
|
|
Loading…
Reference in a new issue