Declare a layer with no dependencies on other layers

For a domain layer that should stand alone, an empty allowlist expresses the boundary directly.

Declare an empty dependency allowlist#

Use an explicit empty list for may_depend_on. The list covers other declared layers. Files within the domain layer can still import one another.

version: 2
architecture:
  layers:
    - name: domain
      paths: ["src/domain/**"]
    - name: storage
      paths: ["src/storage/**"]
  rules:
    - id: domain-isolated
      layer: domain
      may_depend_on: []
      severity: error

Omitting the allowlist removes that restriction. Add a separate forbidden_packages list to describe external packages the layer should avoid. Reviews do not yet evaluate either declaration.

Search help

Tab to a result. Enter to open. Escape to close.