diff --git a/eslint.config.js b/eslint.config.js index 1d5e10ab..70dafc8c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -10,7 +10,9 @@ import reactHooks from 'eslint-plugin-react-hooks' import tseslint from 'typescript-eslint' export default tseslint.config( - // 构建产物 / 工具目录不参与 lint(node_modules 与点开头目录默认也不进)。 + // 构建产物 / 工具目录不参与 lint(node_modules 默认不进,但**点开头目录 + // 并不自动排除**——`.worktrees/` 与 `.delta/` 都必须显式列出,否则 ESLint + // 会走进那些陈旧检出,把别的分支的错误报成我们的:实测一次 1115 errors)。 { ignores: [ 'lib/', @@ -21,6 +23,7 @@ export default tseslint.config( 'test-results/', 'node_modules/', '.worktrees/', + '.delta/', ], }, diff --git a/vitest.config.ts b/vitest.config.ts index c0608e3c..929ce12f 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -49,6 +49,11 @@ export default defineConfig({ // Local dev worktrees (pnpm/DSH-style task branches) may carry stale // code against this checkout's node_modules — never collect them. '**/.worktrees/**', + // Same hazard, different directory: the DSH worktree lanes keep their + // checkouts under `.delta/`, which `.git/info/exclude` ignores but this + // list is the only thing vitest reads. Left out, `pnpm test` collects + // those stale copies and reports THEIR failures as ours. + '**/.delta/**', '**/node_modules/**', '**/dist/**', '**/cypress/**',