Skip to content

Commit

Permalink
nit: simplify to .some
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Jul 16, 2023
1 parent 95dd600 commit 35462fc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/eslint-plugin/src/util/collectUnusedVariables.ts
Expand Up @@ -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) {
Expand All @@ -434,7 +434,6 @@ function isExported(variable: TSESLint.Scope.Variable): boolean {

return node.parent!.type.indexOf('Export') === 0;
});
return exportedDefinition !== undefined;
}

/**
Expand Down

0 comments on commit 35462fc

Please sign in to comment.