Skip to content

Exclude .claude/worktrees from ESLint to clean lint output #53

@studert

Description

@studert

Problem

pnpm lint currently reports 20 ESLint errors — every one of them comes from generated files in .claude/worktrees/<branch>/.next/ directories created by Claude Code's worktree feature. None of them are real source files; they are throwaway build artifacts in temporary worktrees that get cleaned up automatically. The noise hides any real lint regressions.

Evidence

  • pnpm lint 2>&1 | head -30 shows errors only under .claude/worktrees/.../.next/.
  • pnpm exec eslint src --max-warnings 0 is clean — confirming the issue is purely the worktree artifacts.

Proposed approach

  1. Open eslint.config.mjs (flat config — top-level ignores array).
  2. Add .claude/worktrees/** (and **/.next/** for safety) to the global ignores:
    {
      ignores: [
        \".claude/worktrees/**\",
        \"**/.next/**\",
        \"node_modules/**\",
        \"dist/**\",
        // ...existing ignores
      ],
    },
  3. Confirm pnpm lint returns zero errors after the change.
  4. Update .gitignore if .claude/worktrees is not already covered (it should be, but verify).

Acceptance criteria

  • pnpm lint exits 0 with no errors and no warnings.
  • pnpm exec eslint src --max-warnings 0 continues to be clean.
  • .claude/worktrees/ directory is git-ignored (confirm with git check-ignore).
  • pnpm typecheck still passes.

Verification

  1. pnpm lint → exit 0, zero errors.
  2. Create an obvious lint error in src/lib/utils.ts (e.g. unused variable) → pnpm lint reports it. Revert.
  3. Re-run pnpm lint → clean again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions