mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(prettier): improve the format of ReturnStatement to support longer width (#1336)
This commit is contained in:
parent
2bed242016
commit
8d7c0d73d1
1 changed files with 9 additions and 1 deletions
|
|
@ -254,8 +254,16 @@ impl<'a> Format<'a> for ReturnStatement<'a> {
|
|||
parts.push(ss!("return"));
|
||||
if let Some(argument) = &self.argument {
|
||||
parts.push(ss!(" "));
|
||||
parts.push(format!(p, argument));
|
||||
parts.push(group![
|
||||
p,
|
||||
if_break!("("),
|
||||
indent!(p, softline!(), format!(p, argument)),
|
||||
softline!(),
|
||||
if_break!(")")
|
||||
]);
|
||||
}
|
||||
parts.push(p.str(";"));
|
||||
parts.push(hardline!());
|
||||
Doc::Array(parts)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue