ShtukbaseStandard
página del paquete→ /norms/rules/design-components/DSC-R03.md

pages/norms/rules/design-components/DSC-R03.md

29 líneas, 1.5 KB. Como página.

Este texto aún no está traducido. Debajo está el original en inglés.

  1. ---
  2. type: Rule
  3. ruleId: DSC-R03
  4. title: 'A component does not use a component of a higher level'
  5. requirement: 'A component uses only components of its own level or below (primitive, composite, block, page), and the uses do not go in a circle.'
  6. level: MUST
  7. floor: false
  8. status: active
  9. sphere: design
  10. appliesTo: [/design]
  11. enforcers: [.shtukbase/packages/design-components/checks/no-level-up.ts]
  12. enforcerKind: gate
  13. mode: enforce
  14. because: 'The levels are what makes the library a tree: a button that is built from a card cannot be used inside a card. A dependency that points up, or in a circle, breaks the order the catalog and the registry rely on.'
  15. baseline: 0
  16. reviewBy: 2027-05-29
  17. pack: design-components
  18. rail: 'Move the shared part down into a primitive, or lift the component to the higher level.'
  19. ---
  20. A component uses only components of its own level or below (`primitive` < `composite` < `block` < `page`), and the `uses` do not go in a circle.
  21. **What counts as a violation.** A primitive that uses a composite, a composite that uses a block, and so on up; or a component that reaches itself through its `uses`.
  22. **Why.** The levels are what makes the library a tree: a button that is built from a card cannot be used inside a card. A dependency that points up, or in a circle, breaks the order the catalog and the registry rely on.
  23. **Run.** `shtuk run design-components no-level-up`. A violation is a line, exit code 1.
  24. **How to fix.** Move the shared part down into a primitive, or lift the component to the higher level.