Skip to content

app-code-in-layers

Field Value
Tool Dependency Cruiser
Enable via layout({ scope })
Severity error
Kind module rule (reports the file)
Source packages/rules/src/dependency-cruiser.cjs
Docs packages/rules/docs/dependency-cruiser.md

App code outside layer folders.

{
"name": "app-code-in-layers",
"severity": "error",
"module": {
"path": "^apps/[^/]+/src/",
"pathNot": [
"^apps/[^/]+/src/(?:delivery|server|use-cases)/",
"^apps/[^/]+/src/(?:main[.]ts|index[.]ts)$",
"(?:^|/)(?:tests?|__tests__)(?:/|$)|[.](?:test|spec)[.][^/]+$"
],
"numberOfDependentsLessThan": 100
},
"from": {}
}

This rule is one of several in the Dependency Cruiser preset. The Dependency Cruiser page carries the full preset docs from packages/rules/docs/dependency-cruiser.md.

All rules · Dependency Cruiser rules