From 8892284879a0632ee9d6633545b32241ca09ebd9 Mon Sep 17 00:00:00 2001 From: SylvainDruaux Date: Tue, 24 Nov 2026 22:33:54 +0100 Subject: [PATCH] fix(check): give check:local's ESLint the gate's memory npm run dev stopped starting: check:local, its first step, aborted in ESLint with "node: stopped by SIGABRT". I noticed it after Homebrew updated Node to 26.13.1, but the update is not the cause: Node 22, the version .nvmrc pins, aborts the same way on plain main. The abort is "JavaScript heap out of memory". Type-aware lint of the whole tree now peaks at about 4.7 GB on main, past Node's default heap of about 4 GB. The full gate has given the same ESLint run 6 GB since 1.1.1 (scripts/gate/runTests.ts), so the gate passes while check:local, which runs ESLint without that setting, aborts. runEslint now passes the same --max-old-space-size=6144. The two values are kept equal by a comment, because the gate compiles to CommonJS and cannot import the policy module. With it, check:local passes on main and npm run dev starts again. --- scripts/policy/checks.mts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/policy/checks.mts b/scripts/policy/checks.mts index cdf8d5338..af7d5eba9 100644 --- a/scripts/policy/checks.mts +++ b/scripts/policy/checks.mts @@ -133,7 +133,9 @@ export function runEslint(root: string, files: readonly string[]): ChildResult { const eslint = path.join(root, 'node_modules', 'eslint', 'bin', 'eslint.js'); // No --cache: ESLint keys a cached result on the linted file and the config only, but the type-aware rules also read the types of every file it // imports. A changed dependency therefore left a stale "unsafe argument" verdict that no re-run could clear. - const argumentsList = [eslint, '--no-cache', '--max-warnings', '0', '--no-warn-ignored', ...files]; + // The heap is the full gate's (the eslint check in scripts/gate/runTests.ts): type-aware lint of the whole tree, as check:local runs it, + // passes Node's default heap of about 4 GB and is aborted. The two stay equal; the gate compiles to CommonJS and cannot import this module. + const argumentsList = ['--max-old-space-size=6144', eslint, '--no-cache', '--max-warnings', '0', '--no-warn-ignored', ...files]; return runChild(process.execPath, argumentsList, { cwd: root }); }