-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy path.dependency-cruiser.cjs
More file actions
84 lines (82 loc) · 2.08 KB
/
.dependency-cruiser.cjs
File metadata and controls
84 lines (82 loc) · 2.08 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/** @type {import('dependency-cruiser').IConfiguration} */
module.exports = {
forbidden: [
// ─── Orphan detection ───
{
name: "no-orphans",
comment: "Files not reachable from any entry point are likely dead code",
severity: "warn",
from: {
orphan: true,
pathNot: [
"\\.(test|spec)\\.tsx?$", // test files
"__mocks__", // mock files
"\\.d\\.ts$", // type declaration files
"index\\.ts$", // barrel files (may be entry points)
"src/webviews/explorer/quickActions\\.ts$", // test-only compatibility helper
"src/webviews/imageManager/entry\\.tsx$" // esbuild webview entry point
]
},
to: {}
},
// ─── Path depth limits ───
{
name: "no-deep-relative-imports",
comment: "Prevent imports with more than 3 parent directory traversals (e.g., ../../../../)",
severity: "error",
from: {},
to: {
// Match paths that have 4+ parent directory traversals
path: "^(\\.\\.[\\/]){4,}"
}
},
// ─── Circular dependencies (complementing madge) ───
{
name: "no-circular",
comment: "Circular dependencies are problematic for maintainability",
severity: "error",
from: {},
to: {
circular: true
}
}
],
options: {
doNotFollow: {
path: ["node_modules"]
},
exclude: {
path: [
"out/",
"dist/",
"dist-dev/",
"legacy-backup/",
"labs/",
"dev/",
"\\.test\\.tsx?$",
"\\.spec\\.tsx?$"
]
},
tsPreCompilationDeps: true,
tsConfig: {
fileName: "tsconfig.json"
},
enhancedResolveOptions: {
exportsFields: ["exports"],
conditionNames: ["import", "require", "node", "default"]
},
reporterOptions: {
dot: {
collapsePattern: "node_modules/(@[^/]+/[^/]+|[^/]+)",
theme: {
graph: {
splines: "ortho"
}
}
},
text: {
highlightFocused: true
}
}
}
};