Skip to content

Commit

Permalink
refactor(linter): rename vars from ast_node_id to node_id (#6305)
Browse files Browse the repository at this point in the history
Style nit. We renamed `AstNodeId` to `NodeId`, so rename vars from `ast_node_id` to `node_id` too.
  • Loading branch information
overlookmotel committed Oct 6, 2024
1 parent 020bb80 commit 642725c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit 642725c

Please sign in to comment.