-
Notifications
You must be signed in to change notification settings - Fork 304
/
.dependency-cruiser.js
80 lines (79 loc) · 1.95 KB
/
.dependency-cruiser.js
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
/** @type {import('dependency-cruiser').IConfiguration} */
module.exports = {
forbidden: [
{
name: "shared-restrict-deps",
severity: "error",
comment:
"Modules in shared folders should not depend on client/server modules.",
from: {
path: ["^src/shared/"],
pathNot: "/test/",
},
to: {
path: "^src",
pathNot: [
"^src/shared/",
"^src/gen/shared/",
"^src/third-party/",
"^src/cayley/",
"^src/galois/js/interface/asset_paths.ts",
"^src/galois/js/assets/",
],
},
},
{
name: "third-party-restrict-deps",
severity: "error",
comment:
"Modules in src/shared should not depend on modules outside of src/shared.",
from: {
path: ["^src/third-party"],
},
to: {
path: "^src",
pathNot: ["^src/third-party"],
},
},
{
name: "galois-restrict-deps",
severity: "error",
comment:
"Modules in src/galois/js should not depend on modules outside of src/shared.",
from: {
path: "^src/galois/js",
pathNot: ["^src/galois/js/publish", "^src/galois/js/interface"],
},
to: {
path: "^src",
pathNot: ["^src/shared", "^src/gen/(shared|galois)", "^src/galois/js"],
},
},
],
options: {
doNotFollow: {
path: "node_modules",
},
tsPreCompilationDeps: true,
tsConfig: {
fileName: "tsconfig.json",
},
enhancedResolveOptions: {
exportsFields: ["exports"],
conditionNames: ["import", "require", "node", "default"],
mainFields: ["main", "types"],
},
reporterOptions: {
dot: {
collapsePattern: "node_modules/[^/]+",
},
archi: {
collapsePattern:
"^(packages|src|lib|app|bin|test(s?)|spec(s?))/[^/]+|node_modules/[^/]+",
},
text: {
highlightFocused: true,
},
},
},
};