Import NextRules
enforce-dependency-direction
Ensures dependencies flow in the correct architectural direction
š¼ This rule is enabled in the following configs: recommended, typescript.
š” This rule is automatically fixable by the --fix CLI option.
Ensures dependencies flow in the correct architectural direction
Rule Details
This rule aims to prevent issues related to enforce-dependency-direction.
Options
[
{
"type": "object",
"properties": {
"layers": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"domain",
"application",
"infrastructure",
"presentation"
],
"description": "Layer definitions with dependency order"
},
"layerPatterns": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"domain",
"application",
"infrastructure",
"presentation",
"ui",
"api"
],
"description": "Layer directory patterns"
},
"allowSameLayer": {
"type": "boolean",
"default": true,
"description": "Allow same-layer imports"
}
},
"additionalProperties": false
}
]Implementation
OWASP Foundation
- Category: A00:2021 - General Security