Skip to content

Commit

Permalink
fix: Improper no lone statements
Browse files Browse the repository at this point in the history
  • Loading branch information
vasucp1207 committed Oct 23, 2023
1 parent 65df9a0 commit ebc5d6c
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ fn statement_has_block_level_declaration(statement: &AnyJsStatement, is_module:
}

fn in_control_structure(block: &JsBlockStatement) -> bool {
let syntax_kind = block.syntax().parent().unwrap().kind();
let is_else = JsElseClause::can_cast(syntax_kind);
if is_else {
return true;
if let Some(node) = block.syntax().parent() {
let syntax_kind = node.kind();
if JsElseClause::can_cast(syntax_kind) {
return true;
}
}
matches!(
block.parent(),
Expand Down

0 comments on commit ebc5d6c

Please sign in to comment.