Skip to content

Commit

Permalink
feat(prettier): indent for class definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Sysix committed Sep 25, 2024
1 parent 933105e commit 6aa42cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/oxc_prettier/src/format/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,10 @@ fn print_heritage_clauses_implements<'a>(p: &mut Prettier<'a>, class: &Class<'a>
}));
} else if class.super_class.is_some() {
parts.extend(hardline!());
} else {
parts.push(softline!());
}

parts.push(if_break!(p, " ", ""));
parts.push(ss!("implements "));

let implements_docs = implements.iter().map(|v| v.format(p)).collect();
Expand All @@ -417,7 +418,7 @@ fn has_multiple_heritage(class: &Class) -> bool {
let mut len = if class.super_class.is_some() { 1 } else { 0 };

if let Some(implements) = &class.implements {
len.add(i32::try_from(implements.len()).unwrap());
len = len.add(i32::try_from(implements.len()).unwrap());
}

len > 1
Expand Down

0 comments on commit 6aa42cb

Please sign in to comment.