fix: slow eslint

Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
This commit is contained in:
Gabriel Dugny
2025-05-27 08:29:28 +02:00
parent eef0e83a0d
commit 098ef95bfe
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/eslint-plugin': patch
---
Fix custom rules package scanning performance.
@@ -319,6 +319,7 @@ module.exports = {
if (importsToAdd.length > 0) {
addMissingImports(importsToAdd, packages, localPkg);
packages.clearCache();
// This switches all import directives back to the original import.
for (const added of importsToAdd) {
context.report({
@@ -336,6 +337,7 @@ module.exports = {
removeInlineImports(importsToInline, localPkg);
addForwardedInlineImports(importsToInline, localPkg);
packages.clearCache();
for (const inlined of importsToInline) {
context.report({
node: inlined.node,
@@ -350,8 +352,6 @@ module.exports = {
}
importsToInline.length = 0;
}
packages.clearCache();
},
...visitImports(context, (node, imp) => {
// We leave checking of type imports to the repo-tools check,