From 7985e53f278f49660d7581efb12b8907222c71a0 Mon Sep 17 00:00:00 2001 From: Thunpisit Amnuaikiatloet Date: Sun, 3 May 2026 17:28:56 +0700 Subject: [PATCH] fix: 7 ESLint errors blocking CI on fresh install (closes #47) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CI gate (.github/workflows/deploy.yml) runs `pnpm run lint`, which fails on every push because of legitimately-flagged code patterns. None of these are real bugs — they're cases where the linter rule is correct in general but doesn't fit our specific intent. Fixed each at the smallest scope: - CookieBanner.svelte: privacyHref is operator-supplied (built from layout's `localePath()` → /[locale]/privacy-policy), not a build-time route — eslint-disable for svelte/no-navigation-without-resolve. - Seo.svelte: emit JSON-LD via concatenated string + escaped sequence so untrusted JSON values can't break out; eslint-disable svelte/no-at-html-tags + drop the unnecessary `\/` escape. - webhooks/index.ts: drop the dead initializer on `responseExcerpt` (every code path reassigns before reading). - dashboard/+page.server.ts: drop unused `and` from drizzle-orm import. - media/+page.svelte: lookup map is local to a $derived block, rebuilt every invocation, never reactive — plain Map is correct; eslint-disable svelte/prefer-svelte-reactivity with rationale. - (www)/[locale]/[...slug]/+page.svelte: trusted server-rendered markdown — same eslint-disable pattern blog/[slug] already uses. After: `pnpm run lint` reports 0 errors (407 paraglide-generated prettier warnings remain — those are auto-generated and gitignored in spirit; separate cleanup). Build still green; svelte-check unchanged. Co-Authored-By: Claude Opus 4.7 --- src/lib/components/consent/CookieBanner.svelte | 1 + src/lib/components/seo/Seo.svelte | 11 +++++++++-- src/lib/server/webhooks/index.ts | 4 +++- src/routes/(cms)/cms/dashboard/+page.server.ts | 2 +- src/routes/(cms)/cms/media/+page.svelte | 5 ++++- src/routes/(www)/[locale]/[...slug]/+page.svelte | 1 + 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/lib/components/consent/CookieBanner.svelte b/src/lib/components/consent/CookieBanner.svelte index 3742bee..9ada8ff 100644 --- a/src/lib/components/consent/CookieBanner.svelte +++ b/src/lib/components/consent/CookieBanner.svelte @@ -46,6 +46,7 @@

{m.cookie_banner_title()}

{m.cookie_banner_body()} + {m.cookie_banner_learn_more()}

{#if detailsOpen} diff --git a/src/lib/components/seo/Seo.svelte b/src/lib/components/seo/Seo.svelte index f04141f..0431ba6 100644 --- a/src/lib/components/seo/Seo.svelte +++ b/src/lib/components/seo/Seo.svelte @@ -88,9 +88,16 @@ {/if} - + {#each jsonLd as ld, i (i)} - {@html ` escaped --> + {@html '