Repository navigation
ignore claude agent worktrees in jest, eslint and prettier - #351
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-coreetc. packages and fails most suites with jest-haste-map naming collisions (18/22 suites).pnpm lintfails with a parser error because the worktree files aren't intsconfig.eslint.json, andpnpm format:check(which uses.gitignore) checks their files too.Approach
jest.config.ts: add<rootDir>/.claude/tomodulePathIgnorePatterns(keeps it out of the haste map) andtestPathIgnorePatterns.eslint.config.mjs: ignore.claude/worktrees/**..gitignore: ignore.claude/worktrees/, which also covers prettier and lint-staged (both use--ignore-path .gitignore).tsconfig*.jsonincludes and thepnpm-workspace.yamlglobs are rooted atpackages/, so they don't need changing. Verified with a dummy.claude/worktrees/x/packages/bus-corecopy: the haste collision, lint error and prettier warning appeared before the change and are gone after it.pnpm test:unit(52 suites),pnpm lintandpnpm format:checkpass. No changeset: repo tooling only.pnpm changeset) for user-facing changes to published packages, or none is neededdocs/for user-facing changes, or none needed🤖 Generated with Claude Code