Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(linter): rename vars from ast_node_id to node_id #6305

Merged
Show file tree
Hide file tree
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
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