👷 exclude worktree directories from linting and formatting#147
Conversation
There was a problem hiding this comment.
Pull request overview
PR Review — Score: 4.9 / 5
I would approve this change. It cleanly removes lint/format noise by excluding worktree directories from ESLint and Prettier, without affecting source code or build outputs.
Why 4.9: Minimal, targeted ignore patterns; consistent with existing ESLint ignore strategy (e.g., .claude/**, dist, coverage); low regression risk.
Why not 5: No automated check specifically asserting these ignore behaviors (understandable for a tooling-config tweak, but it does mean the behavior relies on manual verification).
Findings
| Severity | Item |
|---|---|
| Minor | No blocking issues found — Changes are straightforward and align with the PR motivation. |
Architectural flow
flowchart TD
A[Developer runs yarn lint / yarn format:check] --> B[Tool enumerates files from repo root]
B --> C{Path matches ignore patterns?}
C -->|Yes| D[Skip file/dir]
C -->|No| E[Analyze/format file]
D --> F[Less noise + faster checks]
E --> F
Before: ESLint/Prettier would discover and process files inside .worktrees/ (and Prettier could also process .claude/worktrees/), producing unrelated warnings/errors.
After: ESLint ignores .worktrees/** via flat-config ignores, and Prettier ignores .worktrees and .claude/worktrees via .prettierignore, preventing worktree content from being scanned.
Changes:
- Add
.worktrees/**to ESLint ignore patterns. - Add
.worktreesand.claude/worktreesto Prettier ignore patterns.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| eslint.config.mjs | Excludes .worktrees/** from ESLint file traversal to avoid linting isolated workspaces. |
| .prettierignore | Prevents Prettier from formatting/checking worktree directories (.worktrees, .claude/worktrees). |
Motivation
Worktree directories (
.worktrees/and.claude/worktrees/) were being picked up by ESLint and Prettier, causing noise during checks. These directories contain isolated workspaces unrelated to the project source.Changes
.worktrees/**to ESLint ignores ineslint.config.mjs.worktreesand.claude/worktreesto.prettierignoreTest instructions
Run
yarn lintandyarn format:check— neither should scan files inside.worktrees/or.claude/worktrees/.Checklist