mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(prettier): print es5 comma for object expression (#1574)
This commit is contained in:
parent
c5b138f006
commit
a9f0206805
3 changed files with 5 additions and 4 deletions
|
|
@ -100,7 +100,9 @@ pub(super) fn print_object_properties<'a>(
|
|||
}
|
||||
indent_parts
|
||||
}));
|
||||
parts.push(if_break!(p, ",", "", None));
|
||||
if p.should_print_es5_comma() {
|
||||
parts.push(if_break!(p, ",", "", None));
|
||||
}
|
||||
parts.push(if p.options.bracket_spacing { line!() } else { softline!() });
|
||||
parts.push(ss!("}"));
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ impl<'a> Prettier<'a> {
|
|||
unsafe { std::mem::transmute(t) }
|
||||
}
|
||||
|
||||
fn should_print_es5_comma(&self) -> bool {
|
||||
pub fn should_print_es5_comma(&self) -> bool {
|
||||
self.should_print_comma_impl(false)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Compatibility: 193/580 (33.28%)
|
||||
Compatibility: 194/580 (33.45%)
|
||||
|
||||
# Failed
|
||||
|
||||
|
|
@ -550,7 +550,6 @@ Compatibility: 193/580 (33.28%)
|
|||
* trailing-comma/es5.js
|
||||
* trailing-comma/function-calls.js
|
||||
* trailing-comma/jsx.js
|
||||
* trailing-comma/object.js
|
||||
* trailing-comma/trailing_whitespace.js
|
||||
|
||||
### try
|
||||
|
|
|
|||
Loading…
Reference in a new issue