From 53f6a959e2f9721ac676a91bbda58dfd7121a1d9 Mon Sep 17 00:00:00 2001 From: kingwl Date: Fri, 10 Jul 2026 21:15:48 +0800 Subject: [PATCH] chore(lint): one shared project service; ignore harness-local .claude state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two independent multipliers were pushing bare `pnpm run lint` past node's default heap: 1. parserOptions.project expanded to every package tsconfig plus the root one — each matched config built its OWN ts.Program, and the dev paths map pulls sibling package SOURCES (plus the vendored Cordis stack) into every such program, so resident memory grew as sum-of-closures, not repo size: ~4.6 GB peak for 425 repo files. projectService shares one tsserver-style graph: ~2.0 GB peak, ~28 s → ~14 s wall. 2. `eslint .` traversed .claude/ harness-local state — stale worktree checkouts there carry tens of thousands of additional .ts files (whole-repo copies), roughly tripling the work again even under the project service. Other checkouts are not this one's sources; ignore them like node_modules. (#169 carries the identical ignore line inside its chain; the hunks dedupe on its next rebase.) Type-aware rules verified live under the service: a floating-promise probe still trips no-floating-promises. --- eslint.config.mjs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index cbb696bccb..c62d3e9739 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -22,6 +22,7 @@ export default tseslint.config( '**/lib/**', '**/node_modules/**', '**/.sessions/**', + '.claude/**', // harness-local state (worktrees, skills) — other checkouts, not this one's sources '**/.doc-typecheck-*/**', 'vendor/**', // vendored source keeps upstream style and idioms '**/*.js', @@ -38,7 +39,14 @@ export default tseslint.config( ], languageOptions: { parserOptions: { - project: ['./packages/*/*/tsconfig.json', './tsconfig.json'], + // One shared tsserver-style project service instead of 60+ standalone + // per-package programs: the old `project` glob built every package's + // full dependency closure (sibling sources via the dev `paths` map + + // the vendored Cordis stack) as its own program and kept them all + // resident — ~5 GB peak, an OOM past node's default heap. The service + // resolves each file to its nearest owning tsconfig and shares the + // graph. + projectService: true, tsconfigRootDir: import.meta.dirname, }, }, @@ -89,7 +97,9 @@ export default tseslint.config( ], languageOptions: { parserOptions: { - project: ['./tsconfig.json'], + // Same shared project service as the src block: test files resolve + // through the root tsconfig (its include covers every tests/ tree). + projectService: true, tsconfigRootDir: import.meta.dirname, }, },