design-system
design-system copied to clipboard
Rename Components to Follow Naming Convention
Naming Convention
We have a component naming convention that should be consistently applied across the codebase:
- Prefix: All component names must start with
post-. - Dash Count: Component names should contain only one dash by default.
- Example:
post-popovercontainer
- Example:
- 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-tabs➝post-tab-panelpost-accordion➝post-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
Resolution
- Remove the "Dash Count" rule: words should always be separated with a dash
- Keep the two other rules and enforce them using ESLint
Investigate which components would have to be renamed and have a talk about potential breaking changes.