Skip to content

👷 exclude worktree directories from linting and formatting#147

Merged
bcaudan merged 1 commit into
mainfrom
bcaudan/worktree-lint
Jun 25, 2026
Merged

👷 exclude worktree directories from linting and formatting#147
bcaudan merged 1 commit into
mainfrom
bcaudan/worktree-lint

Conversation

@bcaudan

@bcaudan bcaudan commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

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

  • Add .worktrees/** to ESLint ignores in eslint.config.mjs
  • Add .worktrees and .claude/worktrees to .prettierignore

Test instructions

Run yarn lint and yarn format:check — neither should scan files inside .worktrees/ or .claude/worktrees/.

Checklist

  • Tested locally (playground)
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated related documentation.
  • Agentic code review findings addressed or explicitly dismissed.

@bcaudan bcaudan marked this pull request as ready for review June 24, 2026 16:14
@bcaudan bcaudan requested a review from a team as a code owner June 24, 2026 16:14
Copilot AI review requested due to automatic review settings June 24, 2026 16:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading

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 .worktrees and .claude/worktrees to 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).

@bcaudan bcaudan merged commit 2b5e8b9 into main Jun 25, 2026
17 checks passed
@bcaudan bcaudan deleted the bcaudan/worktree-lint branch June 25, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants