From 1714126de55eac39ef9728ed541bc555cf9a1ac5 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 3 Oct 2024 23:00:51 +0930 Subject: [PATCH 1/2] fix(typescript-estree): fix crash when running from a `node --eval` script --- packages/typescript-estree/src/parseSettings/inferSingleRun.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/typescript-estree/src/parseSettings/inferSingleRun.ts b/packages/typescript-estree/src/parseSettings/inferSingleRun.ts index ac0c4d21948f..d1964cb6ce58 100644 --- a/packages/typescript-estree/src/parseSettings/inferSingleRun.ts +++ b/packages/typescript-estree/src/parseSettings/inferSingleRun.ts @@ -51,6 +51,7 @@ export function inferSingleRun(options: TSESTreeOptions | undefined): boolean { process.env.CI === 'true' || // This will be true for invocations such as `npx eslint ...` and `./node_modules/.bin/eslint ...` possibleEslintBinPaths.some(binPath => + process.argv.length > 1 && process.argv[1].endsWith(path.normalize(binPath)), ) ) { From 629a89f47d74b9b2a0fddbb6094eecb96c6bb099 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Thu, 3 Oct 2024 23:41:41 +0930 Subject: [PATCH 2/2] Update inferSingleRun.ts --- .../typescript-estree/src/parseSettings/inferSingleRun.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/typescript-estree/src/parseSettings/inferSingleRun.ts b/packages/typescript-estree/src/parseSettings/inferSingleRun.ts index d1964cb6ce58..8007e6ccd66a 100644 --- a/packages/typescript-estree/src/parseSettings/inferSingleRun.ts +++ b/packages/typescript-estree/src/parseSettings/inferSingleRun.ts @@ -50,9 +50,10 @@ export function inferSingleRun(options: TSESTreeOptions | undefined): boolean { // Default to single runs for CI processes. CI=true is set by most CI providers by default. process.env.CI === 'true' || // This will be true for invocations such as `npx eslint ...` and `./node_modules/.bin/eslint ...` - possibleEslintBinPaths.some(binPath => - process.argv.length > 1 && - process.argv[1].endsWith(path.normalize(binPath)), + possibleEslintBinPaths.some( + binPath => + process.argv.length > 1 && + process.argv[1].endsWith(path.normalize(binPath)), ) ) { return !process.argv.includes('--fix');