Skip to content

Commit 4cf55de

Browse files
authored
[eslint-bulk] Fix caching during eslintrc lookup (#5065)
Co-authored-by: David Michon <dmichon-msft@users.noreply.github.com>
1 parent b2465b0 commit 4cf55de

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@rushstack/eslint-patch",
5+
"comment": "Fix a performance issue when locating \".eslint-bulk-suppressions.json\".",
6+
"type": "patch"
7+
}
8+
],
9+
"packageName": "@rushstack/eslint-patch"
10+
}

eslint/eslint-patch/src/eslint-bulk-suppressions/bulk-suppressions-patch.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ function findEslintrcFolderPathForNormalizedFileAbsolutePath(normalizedFilePath:
110110
) {
111111
const cachedEslintrcFolderPath: string | undefined = eslintrcPathByFileOrFolderPath.get(currentFolder);
112112
if (cachedEslintrcFolderPath) {
113-
return cachedEslintrcFolderPath;
113+
// Need to cache this result into the intermediate paths
114+
eslintrcFolderPath = cachedEslintrcFolderPath;
115+
break;
114116
}
115117

116118
pathsToCache.push(currentFolder);

0 commit comments

Comments
 (0)