From d213773e38fb25c4dd9af5b2e17f39c611ece7ff Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sat, 20 Jul 2024 16:49:19 +0000 Subject: [PATCH] refactor(ast): replace serde rename "lowercase" with "camelCase" (#4376) Replace all `#[serde(rename_all = "lowercase")]` with `#[serde(rename_all = "camelCase")]`, for consistency. In all these cases lowercase and camelcase formatting is the same, so it makes no substantive difference, just better to be consistent. --- crates/oxc_ast/src/ast/js.rs | 6 +++--- crates/oxc_ast/src/ast/ts.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 0214894212d3f..7b712f81cff50 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -325,7 +325,7 @@ pub enum PropertyKey<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] -#[serde(rename_all = "lowercase")] +#[serde(rename_all = "camelCase")] pub enum PropertyKind { Init, Get, @@ -1011,7 +1011,7 @@ pub struct VariableDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] -#[serde(rename_all = "lowercase")] +#[serde(rename_all = "camelCase")] pub enum VariableDeclarationKind { Var, Const, @@ -1688,7 +1688,7 @@ pub enum PropertyDefinitionType { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] -#[serde(rename_all = "lowercase")] +#[serde(rename_all = "camelCase")] pub enum MethodDefinitionKind { Constructor, Method, diff --git a/crates/oxc_ast/src/ast/ts.rs b/crates/oxc_ast/src/ast/ts.rs index c6f8649d0a11b..8ea3639613c18 100644 --- a/crates/oxc_ast/src/ast/ts.rs +++ b/crates/oxc_ast/src/ast/ts.rs @@ -297,7 +297,7 @@ pub struct TSTypeOperator<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] -#[serde(rename_all = "lowercase")] +#[serde(rename_all = "camelCase")] pub enum TSTypeOperatorOperator { Keyof, Unique, @@ -625,7 +625,7 @@ pub struct TSTypeAliasDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] -#[serde(rename_all = "lowercase")] +#[serde(rename_all = "camelCase")] pub enum TSAccessibility { Private, Protected, @@ -727,7 +727,7 @@ pub struct TSCallSignatureDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] -#[serde(rename_all = "lowercase")] +#[serde(rename_all = "camelCase")] pub enum TSMethodSignatureKind { Method, Get, @@ -841,7 +841,7 @@ pub struct TSModuleDeclaration<'a> { #[ast] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serialize", derive(Serialize, Tsify))] -#[serde(rename_all = "lowercase")] +#[serde(rename_all = "camelCase")] pub enum TSModuleDeclarationKind { Global, Module,