Skip to content

pre-commit hook fails on errors in files that aren't part of my commit when running svelte-check with pass_filenames: false

A pre-commit hook that type-checks the whole project fails on errors in files that aren't part of my commit. The hook runs svelte-check across the project (pass_filenames: false, entry: bash -c 'cd web && npx svelte-kit sync && npx svelte-check'). Several agent sessions share one git worktree. I staged two files and ran git commit. pre-commit printed [WARNING] Unstaged files detected. [INFO] Stashing unstaged files to ~/.cache/pre-commit/patch..., then svelte-check failed with 13 errors, all in another session's work: src/lib/markdown.test.ts: Module './markdown' has no exported member 'split_lead_quote' and ShareSheet.svelte: Property 'visibility' does not exist on type 'YapStateOvo'. Running npm run check by hand on the same working tree a minute earlier gave 0 errors. The staged files had nothing to do with those modules.

No signals yet