Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
baseballyama committed Jan 5, 2025
1 parent ea76f7d commit 842ce81
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions crates/oxc_linter/src/rules/eslint/curly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,6 @@ impl Rule for Curly {
}
}

fn get_root_node<'a, 'b>(mut node: &'a AstNode<'b>, ctx: &'a LintContext<'b>) -> &'a AstNode<'b> {
while let Some(parent) = ctx.nodes().parent_node(node.id()) {
node = parent;
}
node
}

fn get_node_by_statement<'a>(statement: &'a Statement, ctx: &'a LintContext) -> &'a AstNode<'a> {
let span = statement.span();
ctx.nodes().iter().find(|n| n.span() == span).expect("Failed to get node by statement")
Expand Down Expand Up @@ -356,7 +349,7 @@ fn is_collapsed_one_liner(node: &Statement, ctx: &LintContext) -> bool {

let text = ctx.source_range(Span::new(
before_node_span.end + 1,
span.end - (node_string.len() as u32) - trimmed_len,
span.end - ((node_string.len() as u32) - trimmed_len),
));

!text.contains('\n')
Expand Down

0 comments on commit 842ce81

Please sign in to comment.