Skip to content

Commit

Permalink
perf(prefer-importing-jest-globals): stop collecting import specifier…
Browse files Browse the repository at this point in the history
…s for no reason (#1646)
  • Loading branch information
eryue0220 committed Sep 2, 2024
1 parent a789420 commit 0660242
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/rules/prefer-importing-jest-globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,10 @@ export default createRule({
defaultOptions: [{ types: allJestFnTypes }],
create(context) {
const { types = allJestFnTypes } = context.options[0] || {};
const importedFunctionsWithSource: Record<string, string> = {};
const functionsToImport = new Set<string>();
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);

Expand Down

0 comments on commit 0660242

Please sign in to comment.