layer inversion
A mistake where a lower layer depends on a higher one, such as a colour token that refers to a button component.
In more detail
Layer inversion breaks the one-way flow of a layered architecture and usually creates a circular dependency. The lesson catches it early by checking each registered node's dependencies and throwing an error when one comes from the same or a higher layer. Lint rules can enforce the same check at compile time.
Related terms
- layered architecture — Organising a system into ranked layers where each layer may only use layers below it.
- circular dependency — Two or more pieces of code or data that depend on each other in a loop, so none can be built or resolved first.
- linter — A tool that reads code or configuration without running it and flags likely mistakes and style problems.
Taught in
- Design Systems Architecture: Foundations, Layers & Taxonomy — Design Systems & Component Engineering