Skip to content

ignore claude agent worktrees in jest, eslint and prettier - #351

Merged
adenhertog merged 2 commits into
masterfrom
chore-jest-ignore-claude-worktrees
Oct 8, 2026
Merged

adenhertog merged 2 commits into
masterfrom
chore-jest-ignore-claude-worktrees

Conversation

@adenhertog

Copy link
Copy Markdown
Contributor

Summary

Make jest, ESLint and prettier skip Claude Code agent worktrees under .claude/worktrees/.

Background

Claude Code agents work in git worktrees at <repo>/.claude/worktrees/<name>, each a full checkout of the repo.

Problem

Tooling run from the main checkout scans those worktrees. Jest finds duplicate @node-ts/bus-core etc. packages and fails most suites with jest-haste-map naming collisions (18/22 suites). pnpm lint fails with a parser error because the worktree files aren't in tsconfig.eslint.json, and pnpm format:check (which uses .gitignore) checks their files too.

Approach

  • jest.config.ts: add <rootDir>/.claude/ to modulePathIgnorePatterns (keeps it out of the haste map) and testPathIgnorePatterns.
  • eslint.config.mjs: ignore .claude/worktrees/**.
  • .gitignore: ignore .claude/worktrees/, which also covers prettier and lint-staged (both use --ignore-path .gitignore).

tsconfig*.json includes and the pnpm-workspace.yaml globs are rooted at packages/, so they don't need changing. Verified with a dummy .claude/worktrees/x/packages/bus-core copy: the haste collision, lint error and prettier warning appeared before the change and are gone after it. pnpm test:unit (52 suites), pnpm lint and pnpm format:check pass. No changeset: repo tooling only.

  • This is original work under the clean-room policy, not ported, translated or copied from another messaging framework
  • Added a changeset (pnpm changeset) for user-facing changes to published packages, or none is needed
  • Docs: updated docs/ for user-facing changes, or none needed

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@adenhertog adenhertog added the no-issue PR not tied to a roadmap issue label Oct 7, 2026
@adenhertog
adenhertog merged commit 158f494 into master Oct 8, 2026
4 checks passed
@adenhertog
adenhertog deleted the chore-jest-ignore-claude-worktrees branch October 8, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-issue PR not tied to a roadmap issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant