Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions crates/oxc_linter/src/ast_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,18 +343,12 @@ pub fn is_method_call<'a>(
}
}

let callee_without_parentheses = call_expr.callee.without_parentheses();
let member_expr = match callee_without_parentheses {
match_member_expression!(Expression) => callee_without_parentheses.to_member_expression(),
Expression::ChainExpression(chain) => match chain.expression.member_expression() {
Some(e) => e,
None => return false,
},
_ => return false,
let Some(member_expr) = call_expr.callee.get_member_expr() else {
return false;
};

if let Some(objects) = objects {
let Expression::Identifier(ident) = member_expr.object().without_parentheses() else {
let Expression::Identifier(ident) = member_expr.object().get_inner_expression() else {
return false;
};
if !objects.contains(&ident.name.as_str()) {
Expand Down