From 6d4936ff854cf4df8754d63f9c82a954208a8f7f Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Mon, 12 May 2025 14:46:52 +0000 Subject: [PATCH] style(ast/estree): reformat `raw_deser` code (#10972) Pure style change. Just reformat code to match `dprint`. --- crates/oxc_ast/src/serialize/js.rs | 2 +- crates/oxc_ast/src/serialize/jsx.rs | 4 ++-- crates/oxc_ast/src/serialize/mod.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/oxc_ast/src/serialize/js.rs b/crates/oxc_ast/src/serialize/js.rs index a82c89e39ba9d..2cf3b88da7433 100644 --- a/crates/oxc_ast/src/serialize/js.rs +++ b/crates/oxc_ast/src/serialize/js.rs @@ -357,7 +357,7 @@ impl ESTree for ArrowFunctionExpressionBody<'_> { ts_type = "IdentifierReference | AssignmentTargetWithDefault", raw_deser = " const init = DESER[Option](POS_OFFSET.init), - keyCopy = {...THIS.key}, + keyCopy = { ...THIS.key }, value = init === null ? keyCopy : { diff --git a/crates/oxc_ast/src/serialize/jsx.rs b/crates/oxc_ast/src/serialize/jsx.rs index 7e7f2f84bb531..c2d4c42617b2a 100644 --- a/crates/oxc_ast/src/serialize/jsx.rs +++ b/crates/oxc_ast/src/serialize/jsx.rs @@ -59,7 +59,7 @@ impl ESTree for JSXOpeningElementSelfClosing<'_, '_> { ts_type = "JSXIdentifier", raw_deser = " const ident = DESER[Box](POS); - {type: 'JSXIdentifier', start: ident.start, end: ident.end, name: ident.name} + { type: 'JSXIdentifier', start: ident.start, end: ident.end, name: ident.name } " )] pub struct JSXElementIdentifierReference<'a, 'b>(pub &'b IdentifierReference<'a>); @@ -78,7 +78,7 @@ impl ESTree for JSXElementIdentifierReference<'_, '_> { ts_type = "JSXIdentifier", raw_deser = " const thisExpr = DESER[Box](POS); - {type: 'JSXIdentifier', start: thisExpr.start, end: thisExpr.end, name: 'this'} + { type: 'JSXIdentifier', start: thisExpr.start, end: thisExpr.end, name: 'this' } " )] pub struct JSXElementThisExpression<'b>(pub &'b ThisExpression); diff --git a/crates/oxc_ast/src/serialize/mod.rs b/crates/oxc_ast/src/serialize/mod.rs index 3c7b03d541120..5d8a8391f51c4 100644 --- a/crates/oxc_ast/src/serialize/mod.rs +++ b/crates/oxc_ast/src/serialize/mod.rs @@ -136,7 +136,7 @@ impl Program<'_> { const first = body[0]; start = first.start; if (first.type === 'ExportNamedDeclaration' || first.type === 'ExportDefaultDeclaration') { - const {declaration} = first; + const { declaration } = first; if ( declaration !== null && declaration.type === 'ClassDeclaration' && declaration.decorators.length > 0