Files
Spoolman/lefthook.yml
DonkieandClaude Opus 4.8 5eb660f420 client_v2: add ESLint + wire lint/format/typecheck into lefthook
client_v2 has matured, so enforce its checks like the old client:

- Add ESLint (typescript-eslint + eslint-plugin-svelte) with a flat
  config; `lint` now runs prettier --check and eslint.
- Add a "Client v2" group to lefthook pre-commit and ci: eslint,
  prettier, and svelte-check type checking (svelte-kit sync first).
- Exclude generated paraglide output from prettier.

Fix the linting warnings this surfaced: drop dead vars and an unused
svelte-ignore, mark intentional reactive reads with `void`, remove a
useless children snippet, and clean up useless string-literal mustaches.

Disable svelte/no-navigation-without-resolve (base-path resolution is
centralized in params.ts helpers, so the rule only false-positives and
wrapping call sites would double-apply the base path). Keep
svelte/prefer-svelte-reactivity on with per-line disables at the
transient-local Set/Map sites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 10:23:17 +02:00

78 lines
3.0 KiB
YAML

pre-commit:
parallel: true
jobs:
- group: # Backend checks
parallel: false
jobs:
- name: Run lint check on backend files
run: uv run ruff check --fix .
stage_fixed: true
- name: Run format check on backend files
run: uv run ruff format .
stage_fixed: true
- name: Check UV lockfile consistency
run: uv lock --check
- group: # Client checks
parallel: false
jobs:
- name: Run lint check on client files
root: "client/"
run: ./node_modules/.bin/eslint --fix . # Hardcoded path because Windows messes up if we use npx
stage_fixed: true
- name: Run format check on client files
root: "client/"
run: ./node_modules/.bin/prettier --write .
stage_fixed: true
- group: # Client v2 checks
parallel: false
jobs:
- name: Run lint check on client_v2 files
root: "client_v2/"
run: ./node_modules/.bin/eslint --fix . # Hardcoded path because Windows messes up if we use npx
stage_fixed: true
- name: Run format check on client_v2 files
root: "client_v2/"
run: ./node_modules/.bin/prettier --write .
stage_fixed: true
- name: Run type check on client_v2 files
root: "client_v2/"
# svelte-kit sync generates .svelte-kit/tsconfig.json, which svelte-check needs.
run: ./node_modules/.bin/svelte-kit sync && ./node_modules/.bin/svelte-check --tsconfig ./tsconfig.json
# Same as pre-commit but no fixes
ci:
parallel: true
jobs:
- group: # Backend checks
parallel: false
jobs:
- name: Run lint check on backend files
run: uv run ruff check .
- name: Run format check on backend files
run: uv run ruff format --check .
- name: Check UV lockfile consistency
run: uv lock --check
- group: # Client checks
parallel: false
jobs:
- name: Run lint check on client files
root: "client/"
run: ./node_modules/.bin/eslint . # Hardcoded path because Windows messes up if we use npx
- name: Run format check on client files
root: "client/"
run: ./node_modules/.bin/prettier --check .
- group: # Client v2 checks
parallel: false
jobs:
- name: Run lint check on client_v2 files
root: "client_v2/"
run: ./node_modules/.bin/eslint . # Hardcoded path because Windows messes up if we use npx
- name: Run format check on client_v2 files
root: "client_v2/"
run: ./node_modules/.bin/prettier --check .
- name: Run type check on client_v2 files
root: "client_v2/"
# svelte-kit sync generates .svelte-kit/tsconfig.json, which svelte-check needs.
run: ./node_modules/.bin/svelte-kit sync && ./node_modules/.bin/svelte-check --tsconfig ./tsconfig.json