-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.dependency-cruiser.json
170 lines (170 loc) · 4.2 KB
/
.dependency-cruiser.json
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
{
"forbidden": [
{
"name": "domain-not-to-depend-on-infra",
"comment": "Don't allow dependencies from domain to infra",
"severity": "error",
"from": {
"path": "^src/domain"
},
"to": {
"path": "^src/infra"
}
},
{
"name": "domain-not-to-depend-on-store",
"comment": "Don't allow dependencies from domain to store",
"severity": "error",
"from": {
"path": "^src/domain"
},
"to": {
"path": "^src/store"
}
},
{
"name": "domain-not-to-depend-on-component",
"comment": "Don't allow dependencies from domain to component",
"severity": "error",
"from": {
"path": "^src/domain"
},
"to": {
"path": "^src/component"
}
},
{
"name": "store-not-to-depend-on-component",
"comment": "Don't allow dependencies from store to component",
"severity": "error",
"from": {
"path": "^src/store"
},
"to": {
"path": "^src/component"
}
},
{
"name": "not-to-test",
"comment": "Don't allow dependencies from outside the test folder to test",
"severity": "error",
"from": {
"pathNot": "__tests__"
},
"to": {
"path": "__tests__"
}
},
{
"name": "not-to-spec",
"comment": "Don't allow dependencies to (typescript/ javascript/ coffeescript) spec files",
"severity": "error",
"from": {},
"to": {
"path": "-test\\.[js|ts|ls|coffee|litcoffee|coffee\\.md]$"
}
},
{
"name": "no-deprecated-core",
"comment": "Warn about dependencies on deprecated core modules.",
"severity": "warn",
"from": {},
"to": {
"dependencyTypes": [
"core"
],
"path": "^(punycode|domain)$"
}
},
{
"name": "no-deprecated-npm",
"comment": "These npm modules are deprecated - find an alternative.",
"severity": "warn",
"from": {},
"to": {
"dependencyTypes": [
"deprecated"
]
}
},
{
"name": "not-to-unresolvable",
"comment": "Don't allow dependencies on modules dependency-cruiser can't resolve to files on disk (which probably means they don't exist)",
"severity": "error",
"from": {},
"to": {
"couldNotResolve": true
}
},
{
"name": "not-to-dev-dep",
"severity": "error",
"comment": "Don't allow dependencies from src/app/lib to a development only package",
"from": {
"path": "^(src|app|lib)",
"pathNot": "__tests__"
},
"to": {
"dependencyTypes": [
"npm-dev"
]
}
},
{
"name": "no-non-package-json",
"severity": "error",
"comment": "Don't allow dependencies to packages not in package.json (except from within node_modules)",
"from": {
"pathNot": "^node_modules"
},
"to": {
"dependencyTypes": [
"unknown",
"undetermined",
"npm-no-pkg",
"npm-unknown"
]
}
},
{
"name": "optional-deps-used",
"severity": "info",
"comment": "nothing serious - but just check you have some serious try/ catches around the import/ requires of these",
"from": {},
"to": {
"dependencyTypes": [
"npm-optional"
]
}
},
{
"name": "peer-deps-used",
"comment": "Warn about the use of a peer dependency (peer dependencies are deprecated with the advent of npm 3 - and probably gone with version 4).",
"severity": "warn",
"from": {},
"to": {
"dependencyTypes": [
"npm-peer"
]
}
},
{
"name": "no-duplicate-dep-types",
"comment": "Warn if a dependency occurs in your package.json more than once (technically: has more than one dependency type)",
"severity": "warn",
"from": {},
"to": {
"moreThanOneDependencyType": true
}
},
{
"name": "no-circular",
"severity": "warn",
"comment": "Warn in case there's circular dependencies",
"from": {},
"to": {
"circular": true
}
}
]
}