fix(frontend): resolve svelte-check type errors
- vite-mock-plugin: define the missing MockFile type and annotate the MOCK_FILES / MOCK_TRASH arrays so restore (unshift) type-checks. - categories/[id], tags/[id]: page.params.id is string | undefined under noUncheckedIndexedAccess — guard loadTags and default the TagRuleEditor tagId so the routes type-check. svelte-check now reports 0 errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -48,7 +48,8 @@
|
||||
void loadTags(id, 0);
|
||||
});
|
||||
|
||||
async function loadTags(id: string, startOffset: number) {
|
||||
async function loadTags(id: string | undefined, startOffset: number) {
|
||||
if (!id) return;
|
||||
tagsLoading = true;
|
||||
try {
|
||||
const params = new URLSearchParams({
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
<!-- Tag rules -->
|
||||
<section class="section">
|
||||
<h2 class="section-title">Implied tags</h2>
|
||||
<TagRuleEditor {tagId} {rules} onRulesChange={(r) => (rules = r)} />
|
||||
<TagRuleEditor tagId={tagId ?? ''} {rules} onRulesChange={(r) => (rules = r)} />
|
||||
</section>
|
||||
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user