chore(test): vitest/eslint 排除 .delta/ 检出——本地门禁假红的根因

`.delta/worktrees/` 是 DSH worktree 通道的陈旧检出,`.git/info/exclude`
忽略它,但 vitest 与 eslint 只读各自的配置,于是本地 `pnpm test` 会收集那些
别的分支的副本、`pnpm lint` 会走进去:实测一次 6 文件 / 7 用例假红与 1115
errors,全部来自 10 月 4–5 日的旧树,而仓库自己的代码是干净的。两处各加一条
排除项(保留既有全部条目——vitest 的 `exclude` 是整体替换语义)。

顺带订正 eslint 配置里「点开头目录默认也不进」这处注释:ESLint 只默认排除
`node_modules`,`.worktrees/` 一直是显式列出的,`.delta/` 漏了。
This commit is contained in:
Menghuan1918 committed 2026-10-13 13:12:04 +08:00
1 parent 751720f4f0
commit a1cf80ef89
2 files changed
+9 -1

No files matched your search

+4 -1
View File
@@ -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/',
],
},
+5
View File
@@ -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/**',