-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.dependency-cruiser.js
More file actions
66 lines (65 loc) · 1.87 KB
/
.dependency-cruiser.js
File metadata and controls
66 lines (65 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
module.exports = {
options: {
exclude: ["__test__", "^(node_modules|coverage|public)"],
},
forbidden: [
{
name: "limit-components-to-outside",
comment: "only allow dependencies from 'components' to 'utils",
severity: "error",
from: { path: "^src/components" },
to: { pathNot: "^(src/)?(utils|components)" },
},
{
name: "limit-models-to-outside",
comment: "only allow dependencies from 'models' to 'utils",
severity: "error",
from: { path: "^src/models" },
to: { pathNot: "^(src/)?(utils|models)" },
},
{
name: "limit-modules-to-outside",
comment:
"only allow dependencies from 'modules' to 'components|models|service|store|utils'",
severity: "error",
from: { path: "^src/modules" },
to: {
pathNot: "^(src/)?(components|modules|models|service|store|utils)",
},
},
{
name: "limit-service-to-outside",
comment: "only allow dependencies from 'service' to 'utils|models'",
severity: "error",
from: { path: "^src/service" },
to: {
pathNot: "^(src/)?(service|utils|models)",
},
},
{
name: "limit-store-to-outside",
comment: "only allow dependencies from 'store' to 'utils|models|service'",
severity: "error",
from: { path: "^src/store" },
to: {
pathNot: "^(src/)?(store|utils|models|service)",
},
},
{
name: "limit-utils-to-outside",
comment: "only allow dependencies from 'utils' to outside",
severity: "error",
from: { path: "^src/utils" },
to: {
pathNot: "^(src/)?utils",
},
},
{
name: "not-page-to-page",
comment: "don't allow dependencies from 'page' to another 'page'",
severity: "error",
from: { path: "^src/pages/(.+/)" },
to: { path: "^(src/)?pages/(?!$1)" },
},
],
};