forked from sverweij/dependency-cruiser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.dependency-cruiser-custom.json
110 lines (110 loc) · 4.69 KB
/
.dependency-cruiser-custom.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
{
"forbidden": [{
"name": "cli-to-main-only",
"comment": "cli should only depend on the public interface in main",
"severity": "error",
"from": { "path": "(^src/cli)" },
"to": { "pathNot": "^src/main|^node_modules|^fs$|^path$|$1" }
}, {
"name": "bin-to-cli-only",
"comment": "bin should only depend on cli",
"severity": "error",
"from": { "path": "(^bin/dependency-cruise)" },
"to": { "pathNot": "^src/cli|^node_modules|^package.json$" }
}, {
"name": "restrict-fs-access",
"comment": "restrict file access to a few modules only",
"severity": "error",
"from": { "pathNot": "^src/(extract/parse|extract/resolve|extract/gatherInitialSources\\.js|cli)|^test" },
"to": { "path": "^fs$" }
}, {
"name": "no-deprecated-core",
"comment": "These core modules are deprecated - find an alternative.",
"severity": "error",
"from": {},
"to": { "dependencyTypes": ["core"], "path": "^(punycode|domain|constants|sys|_linklist)$" }
}, {
"name": "no-inter-module-test",
"severity": "error",
"from": { "path": "(^test/[^\\/]+/)[^\\.]+\\.spec\\.js" },
"to": { "path": "^test/[^\\/]+/.+", "pathNot": "utl|$1[^\\.]+\\.json$"}
}, {
"name": "prefer-no-lodash",
"comment": "We want to minimize the dependency on lodash a bit - so flag dependencies that go there and include it as a whole",
"severity": "info",
"from": {},
"to": { "path": "lodash\\.js"}
}, {
"name": "no-dep-on-test",
"severity": "error",
"from": { "path": "^(src|bin)" },
"to": { "path": "^test|\\.spec\\.(js|ts|ls|coffee|litcoffee|coffee\\.md)$"}
}, {
"name": "no-external-to-here",
"comment": "you never know...",
"severity": "info",
"from": { "pathNot": "^(src|test|bin)" },
"to": { "path": "^(src|test)" }
}, {
"name": "not-to-unresolvable",
"severity": "warn",
"from": {},
"to": { "couldNotResolve": true }
}, {
"name": "not-to-deprecated",
"comment": "These modules are deprecated - find an alternative.",
"severity": "warn",
"from": {},
"to": { "dependencyTypes": ["deprecated"] }
}, {
"name": "not-to-dev-dep",
"severity": "error",
"comment": "because an npm i --production will otherwise deliver an unreliably running module",
"from": { "path": "^(bin|src)"},
"to": { "dependencyTypes": ["npm-dev"] }
}, {
"name": "no-non-package-json",
"severity": "error",
"comment": "because an npm i --production will otherwise deliver an unreliably running module",
"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 try/ catches around the import/ require of these",
"from": {},
"to": { "dependencyTypes": ["npm-optional"] }
}, {
"name": "peer-deps-used",
"comment": "peer dependencies are deprecated with the advent of npm 3 - and probably gone with version 4. Or with yarn.",
"severity": "warn",
"from": {},
"to": { "dependencyTypes": ["npm-peer"] }
},{
"name": "no-duplicate-dep-types",
"severity": "warn",
"from": {},
"to": { "moreThanOneDependencyType": true }
},{
"name": "no-circular",
"severity": "error",
"from": { "pathNot": "^(node_modules)"},
"to": { "circular": true }
},{
"name": "no-orphans",
"severity": "error",
"from": { "orphan": true, "pathNot": "\\.d\\.ts$" },
"to": { }
},{
"name": "no-GPL-license",
"comment": "Warn in case some dependency uses either GPL or APL (the licenses are OK, but your legal department might have 2nd thoughts about them)",
"severity": "warn",
"from": {},
"to": { "license": "GPL|APL" }
}],
"options": {
"exclude": "fixtures",
"doNotFollow": "^node_modules",
"prefix": "https://github.com/sverweij/dependency-cruiser/blob/develop/"
}
}