design-system icon indicating copy to clipboard operation
design-system copied to clipboard

Rename Components to Follow Naming Convention

Open alizedebray opened this issue 5 months ago • 2 comments

Naming Convention

We have a component naming convention that should be consistently applied across the codebase:

  1. Prefix: All component names must start with post-.
  2. Dash Count: Component names should contain only one dash by default.
    • Example: post-popovercontainer
  3. Child Components: If a component is only used as a child of another component, its name should:
    • Begin with the parent component’s name (drop the trailing "s" if plural)
    • Followed by a dash and a specifier.
    • Examples:
      • post-tabspost-tab-panel
      • post-accordionpost-accordion-item

Action Items

  • [ ] Validate the proposed naming convention and align the team on it
  • [ ] Document the convention in:
    • Architectural Decisions
    • Components package contribution guidelines
  • [ ] Create tickets to refactor existing components to follow the agreed naming pattern
  • [ ] Create an ticket for an ESLint rule that enforces the naming convention automatically

alizedebray avatar Jun 24 '25 14:06 alizedebray

Resolution

  • Remove the "Dash Count" rule: words should always be separated with a dash
  • Keep the two other rules and enforce them using ESLint

alizedebray avatar Jun 25 '25 13:06 alizedebray

Investigate which components would have to be renamed and have a talk about potential breaking changes.

alizedebray avatar Jun 26 '25 12:06 alizedebray