Skip to content

chore(devex): stop false-positive LSP diagnostics for .claude/worktrees files (PP-8x3c)#1582

Open
timothyfroehlich wants to merge 1 commit into
mainfrom
chore/lsp-worktree-exclude-PP-8x3c
Open

chore(devex): stop false-positive LSP diagnostics for .claude/worktrees files (PP-8x3c)#1582
timothyfroehlich wants to merge 1 commit into
mainfrom
chore/lsp-worktree-exclude-PP-8x3c

Conversation

@timothyfroehlich

Copy link
Copy Markdown
Owner

What

When working in the main checkout, the editor's tsserver surfaced false-positive TypeScript diagnostics for files living in linked git worktrees under .claude/worktrees/** — unresolved ~/ path aliases, missing @testing-library/jest-dom matchers (toBeInTheDocument/toHaveAttribute), and implicit-any on pre-existing catch params.

Those worktrees are full, git-ignored, machine-local checkouts whose own pnpm run check is green. The diagnostics were pure cross-worktree noise — and during PP-qk7s orchestration they nearly misled a lead agent into "fixing" code that wasn't actually broken.

Root cause

This was never a batch-tsc problem: TypeScript's wildcard walker already skips dot-directories (.claude), so tsc -p tsconfig.json --listFilesOnly includes zero worktree files. The noise came from the editor's tsserver, which discovers/opens files in the workspace tree (including under .claude/worktrees) and analyzes them with the wrong project config.

Fix

  • .vscode/settings.json — add **/.claude/worktrees to files.exclude, search.exclude, and files.watcherExclude. files.exclude is the load-bearing change: tsserver won't analyze files hidden from the workspace, so the spurious diagnostics stop. This mirrors the existing .claude/recycle_bin exclusions.
  • tsconfig.json — add .claude/worktrees/**/* to exclude as explicit intent / belt-and-suspenders for any tool that expands include globs into dot-dirs differently.

Verification

  • Confirmed the resulting tsc program is identical before and after the tsconfig change (401 files in the worktree, byte-for-byte same file list) — zero real src files dropped.
  • pnpm run check green: types, lint, format, 1317 unit tests, 70 python tests.
  • Working inside a worktree directly is unaffected — these exclusions are relative to the main-checkout workspace root.

Closes PP-8x3c.

🤖 Generated with Claude Code

…scope (PP-8x3c)

Working in the main worktree, the editor's tsserver surfaced false-positive
diagnostics (unresolved ~/ aliases, missing jest-dom matchers, implicit-any
catch params) for files living in linked worktrees under .claude/worktrees/**.
Those are full checkouts whose own `pnpm run check` is green; the diagnostics
were pure cross-worktree noise and once nearly misled a lead agent into
"fixing" code that wasn't broken.

- .vscode/settings.json: add **/.claude/worktrees to files.exclude,
  search.exclude, and files.watcherExclude. files.exclude is the load-bearing
  change — tsserver won't analyze files hidden from the workspace, so the
  spurious diagnostics stop. (Batch `tsc` already skipped the dot-dir, so this
  was never an `tsc -p` problem.)
- tsconfig.json: add .claude/worktrees/** to exclude as explicit intent /
  belt-and-suspenders for any tool that expands includes into dot-dirs.
  Verified the tsc program is byte-for-byte identical (401 files) before and
  after — zero real src files dropped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 26, 2026 00:36

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pin-point Ready Ready Preview, Comment Jun 26, 2026 12:37am

Request Review

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.

2 participants