use-cases-do-not-import-use-cases
| Field | Value |
|---|---|
| Tool | Dependency Cruiser |
| Enable via | layout({ scope }) |
| Severity | error |
| Kind | dependency rule |
| Source | packages/rules/src/dependency-cruiser.cjs |
| Docs | packages/rules/docs/dependency-cruiser.md |
What it catches
Section titled “What it catches”Use-case importing another use-case.
As layout({ scope: "@hosti/" }) builds it
Section titled “As layout({ scope: "@hosti/" }) builds it”{ "name": "use-cases-do-not-import-use-cases", "severity": "error", "from": { "path": "^(apps/[^/]+/src/use-cases/[^/]+)", "pathNot": "(?:^|/)(?:tests?|__tests__)(?:/|$)|[.](?:test|spec)[.][^/]+$" }, "to": { "path": "^apps/[^/]+/src/use-cases/[^/]+", "pathNot": [ "^$1(?:/|$)", "(?:^|/)(?:tests?|__tests__)(?:/|$)|[.](?:test|spec)[.][^/]+$" ] }}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.