Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: serde rename to camel case unless in rare cases #387

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

Charlie-XIAO
Copy link
Contributor

Extracted from #370.

The concensus is: enum variants are SCREAMING_SNAKE_CASE and others are camelCase. On in special cases can this rule be broken, e.g. Theme is easier to work with in lowercase (rather than SCREAMING_SNAKE_CASE) because some component libraries take the theme prop as "light" | "dark". Note that we put #[serde(rename_all = "camelCase")] even in cases where this does not have any effect (i.e., when it is only one word). This is for consistency considerations, and in case if we changed the naming or added more props in the future things automatically works.

@Charlie-XIAO Charlie-XIAO merged commit 95fcdeb into main Feb 1, 2025
11 checks passed
@Charlie-XIAO Charlie-XIAO deleted the chore/camel-case branch February 1, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant