diff --git a/common/changes/@rushstack/eslint-patch/eslint-cache-bug_2025-01-07-00-34.json b/common/changes/@rushstack/eslint-patch/eslint-cache-bug_2025-01-07-00-34.json new file mode 100644 index 00000000000..7be887ed6c8 --- /dev/null +++ b/common/changes/@rushstack/eslint-patch/eslint-cache-bug_2025-01-07-00-34.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/eslint-patch", + "comment": "Fix a performance issue when locating \".eslint-bulk-suppressions.json\".", + "type": "patch" + } + ], + "packageName": "@rushstack/eslint-patch" +} \ No newline at end of file diff --git a/eslint/eslint-patch/src/eslint-bulk-suppressions/bulk-suppressions-patch.ts b/eslint/eslint-patch/src/eslint-bulk-suppressions/bulk-suppressions-patch.ts index 72978ceb69a..68b897f7a8c 100644 --- a/eslint/eslint-patch/src/eslint-bulk-suppressions/bulk-suppressions-patch.ts +++ b/eslint/eslint-patch/src/eslint-bulk-suppressions/bulk-suppressions-patch.ts @@ -110,7 +110,9 @@ function findEslintrcFolderPathForNormalizedFileAbsolutePath(normalizedFilePath: ) { const cachedEslintrcFolderPath: string | undefined = eslintrcPathByFileOrFolderPath.get(currentFolder); if (cachedEslintrcFolderPath) { - return cachedEslintrcFolderPath; + // Need to cache this result into the intermediate paths + eslintrcFolderPath = cachedEslintrcFolderPath; + break; } pathsToCache.push(currentFolder);