From 642725cd7d03f735f77e0b24feeea665b1451c2a Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sun, 6 Oct 2024 08:35:51 +0000 Subject: [PATCH] refactor(linter): rename vars from `ast_node_id` to `node_id` (#6305) Style nit. We renamed `AstNodeId` to `NodeId`, so rename vars from `ast_node_id` to `node_id` too. --- crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs | 4 ++-- crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs b/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs index 662082a734b90..5bbc2cf906756 100644 --- a/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs +++ b/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs @@ -98,8 +98,8 @@ impl Rule for MaxClassesPerFile { return; } - let ast_node_id = ctx.semantic().classes().get_node_id(ClassId::from(self.max)); - let span = if let AstKind::Class(class) = ctx.nodes().kind(ast_node_id) { + let node_id = ctx.semantic().classes().get_node_id(ClassId::from(self.max)); + let span = if let AstKind::Class(class) = ctx.nodes().kind(node_id) { class.span } else { Span::new(0, 0) diff --git a/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs b/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs index 927f9d2f280a0..b576cda13be36 100644 --- a/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs +++ b/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs @@ -142,12 +142,12 @@ impl NoDuplicateHooks { } let hook_name = jest_fn_call.name.to_string(); - let parent_ast_node_id = + let parent_node_id = match ctx.nodes().ancestors(node.id()).find(|n| hook_contexts.contains_key(n)) { Some(n) => Some(n), _ => Some(root_node_id), }; - let Some(parent_id) = parent_ast_node_id else { + let Some(parent_id) = parent_node_id else { return; };