Skip to content

Commit

Permalink
chore: simplify indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister committed Nov 29, 2024
1 parent 91c8a57 commit e497c9f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/rules/jsx_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,17 @@ impl Handler for JSXKeyHandler {
check_callback(ctx, &callback.expr)
}
} else if let Expr::Member(member) = callee {
if let Expr::Ident(id) = member.obj {
if id.sym() == "Array" {
if let MemberProp::Ident(member_id) = member.prop {
if member_id.sym() == "from" {
if let Some(el) = node.args.get(1) {
check_callback(ctx, &el.expr);
}
}
}
let Expr::Ident(id) = member.obj else {
return;
};

let MemberProp::Ident(member_id) = member.prop else {
return;
};

if id.sym() == "Array" && member_id.sym() == "from" {
if let Some(el) = node.args.get(1) {
check_callback(ctx, &el.expr);
}
}
}
Expand Down

0 comments on commit e497c9f

Please sign in to comment.