From 066024289ec09e2ecf83db001cc93930aa6288a8 Mon Sep 17 00:00:00 2001 From: eryue0220 Date: Mon, 2 Sep 2024 11:07:45 +0800 Subject: [PATCH] perf(prefer-importing-jest-globals): stop collecting import specifiers for no reason (#1646) --- src/rules/prefer-importing-jest-globals.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/rules/prefer-importing-jest-globals.ts b/src/rules/prefer-importing-jest-globals.ts index 49a5116bc..fcc3bc75f 100644 --- a/src/rules/prefer-importing-jest-globals.ts +++ b/src/rules/prefer-importing-jest-globals.ts @@ -60,19 +60,10 @@ export default createRule({ defaultOptions: [{ types: allJestFnTypes }], create(context) { const { types = allJestFnTypes } = context.options[0] || {}; - const importedFunctionsWithSource: Record = {}; const functionsToImport = new Set(); let reportingNode: TSESTree.Node; return { - ImportDeclaration(node: TSESTree.ImportDeclaration) { - node.specifiers.forEach(specifier => { - if (specifier.type === AST_NODE_TYPES.ImportSpecifier) { - importedFunctionsWithSource[specifier.local.name] = - node.source.value; - } - }); - }, CallExpression(node: TSESTree.CallExpression) { const jestFnCall = parseJestFnCall(node, context);