Skip to content

Commit

Permalink
fix: respect prefer_newline_before_close_bracket with `jsx_attribut…
Browse files Browse the repository at this point in the history
…es_prefer_hanging`
  • Loading branch information
MrFoxPro committed Sep 18, 2024
1 parent 236289e commit 3d3b511
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/generation/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3908,6 +3908,9 @@ fn gen_jsx_opening_element<'a>(node: &JSXOpeningElement<'a>, context: &mut Conte
items.push_force_current_line_indentation();
items.extend(space_if_not_start_line());
}
if context.config.jsx_attributes_prefer_hanging && prefer_newline_before_close_bracket {
items.push_condition(conditions::new_line_if_hanging(start_lsil, None));
}
items.push_sc(sc!("/"));
} else if context.config.jsx_attributes_prefer_hanging && prefer_newline_before_close_bracket {
items.push_condition(conditions::new_line_if_hanging(start_lsil, None));
Expand Down

0 comments on commit 3d3b511

Please sign in to comment.