From a32f5a73d3a032952555b2c422c55c5937b5df52 Mon Sep 17 00:00:00 2001 From: Dunqing <29533304+Dunqing@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:46:21 +0000 Subject: [PATCH] fix(linter/no-array-index-key): compile error due to it uses a renamed API (#7391) Fix: https://github.com/oxc-project/oxc/pull/6960#issuecomment-2490754348 --- crates/oxc_linter/src/rules/react/no_array_index_key.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_linter/src/rules/react/no_array_index_key.rs b/crates/oxc_linter/src/rules/react/no_array_index_key.rs index cbf11b1fd7c4c..3dd9581667c60 100644 --- a/crates/oxc_linter/src/rules/react/no_array_index_key.rs +++ b/crates/oxc_linter/src/rules/react/no_array_index_key.rs @@ -121,7 +121,7 @@ fn check_react_clone_element<'a>( } fn find_index_param_name<'a>(node: &'a AstNode, ctx: &'a LintContext) -> Option<&'a str> { - for ancestor in ctx.nodes().iter_parents(node.id()).skip(1) { + for ancestor in ctx.nodes().ancestors(node.id()).skip(1) { if let AstKind::CallExpression(call_expr) = ancestor.kind() { let Expression::StaticMemberExpression(expr) = &call_expr.callee else { return None;