chore(prettier): allow trailing comma in some macros (#1405)

This commit is contained in:
Boshen 2023-11-18 15:42:39 +08:00 committed by GitHub
parent 323f2f9789
commit c9f7f1308f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -87,7 +87,7 @@ pub fn print_module_specifiers<'a, T: Format<'a>>(
],
if_break!(p, if p.should_print_es5_comma() { "," } else { "" }),
if p.options.bracket_spacing { line!() } else { softline!() },
ss!("}")
ss!("}"),
]);
} else {
parts.push(ss!("{"));

View file

@ -24,7 +24,7 @@ macro_rules! string {
#[macro_export]
macro_rules! indent {
($p:ident, $( $x:expr ),* ) => {
($p:ident, $( $x:expr ),* $(,)?) => {
{
let mut temp_vec = $p.vec();
$(
@ -58,7 +58,7 @@ macro_rules! hardline {
#[macro_export]
macro_rules! array {
($p:ident, $( $x:expr ),* ) => {
($p:ident, $( $x:expr ),* $(,)?) => {
{
let mut temp_vec = $p.vec();
$(
@ -71,7 +71,7 @@ macro_rules! array {
#[macro_export]
macro_rules! group {
($p:ident, $( $x:expr ),* ) => {
($p:ident, $( $x:expr ),* $(,)?) => {
{
let mut temp_vec = $p.vec();
$(