diff --git a/crates/oxc_prettier/src/format.rs b/crates/oxc_prettier/src/format.rs index 8894b81ad..2d6ef9d79 100644 --- a/crates/oxc_prettier/src/format.rs +++ b/crates/oxc_prettier/src/format.rs @@ -159,7 +159,15 @@ impl<'a> Format<'a> for ContinueStatement { impl<'a> Format<'a> for BreakStatement { fn format(&self, p: &mut Prettier<'a>) -> Doc<'a> { - Doc::Line + let mut parts = p.vec(); + parts.push(string!(p, "break")); + + if let Some(label) = &self.label { + parts.push(string!(p, " ")); + parts.push(format!(p, label)); + } + + Doc::Array(parts) } }