Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/kebab-case-categories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@everipedia/iq-utils": major
---

Rename category enum values from snake_case to kebab-case
4 changes: 2 additions & 2 deletions src/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ export type Tag = z.infer<typeof Tag>;

export const Category = z.enum([
"people",
"projects_and_protocols",
"projects-and-protocols",
"organizations",
"cryptoassets",
"exchanges_and_marketplaces",
"exchanges-and-marketplaces",
Comment on lines +182 to +185
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While the intent to use kebab-case is clear, this change introduces an inconsistency with other string enums in this file. For instance, CommonMetaIds consistently uses snake_case for multi-word values (e.g., contract_url, facebook_profile). The EditSpecificMetaIds enum is also inconsistent, with both snake_case and kebab-case values.

To improve overall consistency, I recommend one of two approaches:

  1. Expand this PR to convert other similar enums (like CommonMetaIds) to kebab-case. Since this is already a major breaking change, it's a good opportunity to bundle these related changes.
  2. If a broader change is not feasible, consider reverting this change to maintain consistency with the prevalent snake_case style.

A consistent naming convention is crucial for long-term maintainability.

Suggested change
"projects-and-protocols",
"organizations",
"cryptoassets",
"exchanges_and_marketplaces",
"exchanges-and-marketplaces",
"projects_and_protocols",
"organizations",
"cryptoassets",
"exchanges_and_marketplaces",
References
  1. Adhering to a consistent naming convention for identifiers like enum members improves code readability and maintainability, reducing cognitive load for developers.

"events",
]);
export type Category = z.infer<typeof Category>;
Expand Down
Loading