@@ -19,36 +19,44 @@ const infrastructureLayerPaths = [
19
19
'repository' ,
20
20
] ;
21
21
22
+ const domainLayerPaths = [
23
+ 'domain' ,
24
+ 'entity\\.ts$' ,
25
+ 'aggregate\\.ts$' ,
26
+ 'domain-event\\.ts$' ,
27
+ 'value-object\\.ts$' ,
28
+ ] ;
29
+
22
30
module . exports = {
23
31
forbidden : [
24
32
/* user defined rules */
25
33
{
26
34
name : 'no-domain-to-app-deps' ,
27
35
comment : 'Domain layer cannot depend on application layer' ,
28
36
severity : 'error' ,
29
- from : { path : 'domain' } ,
37
+ from : { path : domainLayerPaths } ,
30
38
to : {
31
- path : [ ... applicationLayerPaths ] ,
39
+ path : applicationLayerPaths ,
32
40
pathNot : [ 'AppRequestContext\\.ts$' ] ,
33
41
} ,
34
42
} ,
35
43
{
36
44
name : 'no-domain-to-infra-deps' ,
37
45
comment : 'Domain layer cannot depend on infrastructure layer' ,
38
46
severity : 'error' ,
39
- from : { path : 'domain' } ,
47
+ from : { path : domainLayerPaths } ,
40
48
to : {
41
- path : [ ... infrastructureLayerPaths ] ,
49
+ path : infrastructureLayerPaths ,
42
50
pathNot : [ 'port\\.ts$' ] ,
43
51
} ,
44
52
} ,
45
53
{
46
54
name : 'no-infra-to-app-deps' ,
47
55
comment : 'Infrastructure layer cannot depend on application layer' ,
48
56
severity : 'error' ,
49
- from : { path : [ ... infrastructureLayerPaths ] } ,
57
+ from : { path : infrastructureLayerPaths } ,
50
58
to : {
51
- path : [ ... applicationLayerPaths ] ,
59
+ path : applicationLayerPaths ,
52
60
pathNot : [ 'AppRequestContext\\.ts$' ] ,
53
61
} ,
54
62
} ,
@@ -65,7 +73,7 @@ module.exports = {
65
73
] ,
66
74
} ,
67
75
to : {
68
- path : [ ... applicationLayerPaths ] ,
76
+ path : applicationLayerPaths ,
69
77
pathNot : [ 'AppRequestContext\\.ts$' ] ,
70
78
} ,
71
79
} ,
0 commit comments