Skip to content

fix: 7 ESLint errors blocking CI on fresh install (closes #47)#49

Merged
thunpisit merged 1 commit intomainfrom
fix/lint-errors-issue-47
May 3, 2026
Merged

fix: 7 ESLint errors blocking CI on fresh install (closes #47)#49
thunpisit merged 1 commit intomainfrom
fix/lint-errors-issue-47

Conversation

@thunpisit
Copy link
Copy Markdown
Contributor

Summary

Closes #47. CI's gate job runs `pnpm run lint` which fails on every push due to 7 legitimately-flagged code patterns. None are real bugs — each fix scoped narrowly:

File Rule Fix
`CookieBanner.svelte` `svelte/no-navigation-without-resolve` privacyHref is operator-supplied — eslint-disable with rationale
`Seo.svelte` `svelte/no-at-html-tags` + `no-useless-escape` concat + escape `</script>` so JSON values can't break out; eslint-disable
`webhooks/index.ts` `no-useless-assignment` drop dead initializer on `responseExcerpt`
`dashboard/+page.server.ts` `@typescript-eslint/no-unused-vars` drop unused `and` import
`media/+page.svelte` `svelte/prefer-svelte-reactivity` local-scope Map in `$derived.by`, never reactive — eslint-disable
`[locale]/[...slug]/+page.svelte` `svelte/no-at-html-tags` trusted server-rendered markdown — same eslint-disable as blog/[slug]

After:
```
✖ 407 problems (0 errors, 407 warnings)
```
407 warnings are all paraglide-generated files (gitignored in spirit) — separate cleanup.

Test plan

  • `pnpm run lint` → 0 errors
  • `pnpm run build` succeeds
  • `svelte-check` unchanged
  • After merge: deploy.yml gate job passes

🤖 Generated with Claude Code

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
  </script> 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 <noreply@anthropic.com>
@thunpisit thunpisit merged commit 174267e into main May 3, 2026
@thunpisit thunpisit deleted the fix/lint-errors-issue-47 branch May 3, 2026 10:29
thunpisit added a commit to codustry/khaopad-example that referenced this pull request May 3, 2026
codustry#49 + PR codustry#50) (#15)

Cherry-picks both upstream fixes:
- PR codustry#49 (closes codustry#47) — 7 ESLint errors blocking CI on fresh install
- PR codustry#50 (closes codustry#48) — switch articles_fts from contentless to
  external-content FTS5; UPDATE/DELETE on article_localizations no
  longer throws SQLITE_ERROR

Migration 0011 already applied to live D1 (same database serves both
repos).

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint: 18 ESLint errors break CI on fresh pnpm install

1 participant