-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdependency-cruiser.config.cjs
More file actions
90 lines (90 loc) · 2.61 KB
/
Copy pathdependency-cruiser.config.cjs
File metadata and controls
90 lines (90 loc) · 2.61 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
85
86
87
88
89
90
/** @type {import('dependency-cruiser').IConfiguration} */
module.exports = {
forbidden: [
{
name: 'no-circular-dependencies',
severity: 'error',
from: {},
to: { circular: true }
},
{
name: 'no-unresolved-local-imports',
severity: 'error',
from: { path: '^src' },
to: { couldNotResolve: true, pathNot: '^node:' }
},
{
name: 'features-do-not-depend-on-routes',
severity: 'error',
from: { path: '^src/features/' },
to: { path: '^src/routes/' }
},
{
name: 'features-do-not-depend-on-app',
severity: 'error',
from: { path: '^src/features/' },
to: {
path: '^src/app/',
pathNot: '^src/app/(dashboardTargets|i18nContext|shellUrl)\\.tsx?$'
}
},
{
name: 'entities-stay-below-features-and-routes',
severity: 'error',
from: { path: '^src/entities/' },
to: { path: '^src/(features|routes|app)/' }
},
{
name: 'design-is-independent',
severity: 'error',
from: { path: '^src/design/' },
to: { path: '^src/(app|routes|features|entities|data|visualization)/' }
},
{
name: 'data-is-ui-independent',
severity: 'error',
from: { path: '^src/data/' },
to: { path: '^src/(app|routes|features|entities|design|visualization)/' }
},
{
name: 'routes-do-not-depend-on-app',
severity: 'error',
from: { path: '^src/routes/' },
to: { path: '^src/app/' }
},
{
name: 'visualization-spec-is-renderer-and-react-free',
severity: 'error',
from: { path: '^src/visualization/spec/' },
to: { path: '(^react$|^react/|^echarts($|/)|src/visualization/(renderer|react)/)' }
},
{
name: 'visualization-fixtures-are-ui-free',
severity: 'error',
from: { path: '^src/visualization/fixtures/' },
to: { path: '(^react$|^react/|^echarts($|/)|src/visualization/(renderer|react|lab)/)' }
},
{
name: 'echarts-is-confined-to-visualization-renderer',
severity: 'error',
from: { path: '^src/', pathNot: '^src/visualization/renderer/' },
to: { path: '^echarts($|/)' }
},
{
name: 'data-contracts-are-react-and-fixture-free',
severity: 'error',
from: { path: '^src/data/contracts/' },
to: { path: '(^react$|^react/|src/(fixtures|test-fixtures)/)' }
}
],
options: {
doNotFollow: { path: 'node_modules' },
tsConfig: { fileName: 'tsconfig.json' },
enhancedResolveOptions: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts']
},
reporterOptions: {
text: { highlightFocused: true }
}
}
};