Skip to content

Commit

Permalink
fix(eslint-plugin): [no-implied-eval] improve performance (#4313)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeauclair committed Dec 15, 2021
1 parent 6626bd2 commit e344596
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/eslint-plugin/src/rules/no-implied-eval.ts
Expand Up @@ -135,15 +135,14 @@ export default util.createRule({
function checkImpliedEval(
node: TSESTree.NewExpression | TSESTree.CallExpression,
): void {
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.callee);
const type = checker.getTypeAtLocation(tsNode);

const calleeName = getCalleeName(node.callee);
if (calleeName === null) {
return;
}

if (calleeName === FUNCTION_CONSTRUCTOR) {
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.callee);
const type = checker.getTypeAtLocation(tsNode);
const symbol = type.getSymbol();
if (symbol) {
const declarations = symbol.getDeclarations() ?? [];
Expand Down

0 comments on commit e344596

Please sign in to comment.