From 35462fc783b379605feaf09ce9c81b0dbfacd777 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 16 Jul 2023 19:47:23 -0400 Subject: [PATCH] nit: simplify to .some --- packages/eslint-plugin/src/util/collectUnusedVariables.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index 10b67877e65..dad984c1f58 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -423,7 +423,7 @@ function isMergableExported(variable: TSESLint.Scope.Variable): boolean { * @returns True if the variable is exported, false if not. */ function isExported(variable: TSESLint.Scope.Variable): boolean { - const exportedDefinition = variable.defs.find(definition => { + return variable.defs.some(definition => { let node = definition.node; if (node.type === AST_NODE_TYPES.VariableDeclarator) { @@ -434,7 +434,6 @@ function isExported(variable: TSESLint.Scope.Variable): boolean { return node.parent!.type.indexOf('Export') === 0; }); - return exportedDefinition !== undefined; } /**