Skip to content

Commit

Permalink
fix(ast): few serialization issues (#2522)
Browse files Browse the repository at this point in the history
A few more I missed in #2506. Re #2463.

Only remaining snake_case in the current types of the AST:
`trailing_comma` in ArrayExpression, ObjectExpression &
ArrayAssignmentTarget.
  • Loading branch information
ArnaudBarre committed Feb 27, 2024
1 parent 76add55 commit 6d5ec6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/oxc_ast/src/ast/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,7 @@ pub struct ImportNamespaceSpecifier<'a> {
}

#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct WithClause<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
Expand Down Expand Up @@ -2322,7 +2322,7 @@ impl<'a> ImportAttributeKey<'a> {
}

#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct ExportNamedDeclaration<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
Expand Down Expand Up @@ -2362,7 +2362,7 @@ impl<'a> ExportDefaultDeclaration<'a> {
}

#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct ExportAllDeclaration<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
Expand All @@ -2380,7 +2380,7 @@ impl<'a> ExportAllDeclaration<'a> {
}

#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct ExportSpecifier<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_ast/src/ast/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface TSAbstractMethodDefinition extends Omit<MethodDefinition, 'type
"#;

#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(tag = "type", rename_all = "camelCase"))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub struct TSThisParameter<'a> {
#[cfg_attr(feature = "serde", serde(flatten))]
Expand Down Expand Up @@ -810,7 +810,7 @@ pub struct TSImportAttribute<'a> {
}

#[derive(Debug, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize), serde(rename_all = "camelCase"))]
#[cfg_attr(feature = "serde", derive(Serialize), serde(untagged))]
#[cfg_attr(all(feature = "serde", feature = "wasm"), derive(tsify::Tsify))]
pub enum TSImportAttributeName<'a> {
Identifier(IdentifierName<'a>),
Expand Down

0 comments on commit 6d5ec6d

Please sign in to comment.