-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.module-boundaries.js
55 lines (53 loc) · 1.73 KB
/
.eslintrc.module-boundaries.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
const backendConstraints = require('./.eslint/.eslintrc.module-boundaries.backend').constraints;
const clientConstraints = require('./.eslint/.eslintrc.module-boundaries.client').constraints;
const sharedConstraints = require('./.eslint/.eslintrc.module-boundaries.shared').constraints;
const workspaceConstraints = require('./.eslint/.eslintrc.module-boundaries.workspace').constraints;
/**
* Type constraints for the module boundary rules based on scopes.
*/
const typeConstraints = [
{
sourceTag: 'type:application',
onlyDependOnLibsWithTags: ['type:feature', 'type:data-access', 'type:ui', 'type:util', 'type:testing-unit'],
},
{
sourceTag: 'type:feature',
onlyDependOnLibsWithTags: ['type:feature', 'type:data-access', 'type:ui', 'type:util', 'type:testing-unit'],
},
{
sourceTag: 'type:data-access',
onlyDependOnLibsWithTags: ['type:data-access', 'type:util', 'type:testing-unit'],
},
{
sourceTag: 'type:ui',
onlyDependOnLibsWithTags: ['type:ui', 'type:util', 'type:testing-unit'],
},
{
sourceTag: 'type:util',
onlyDependOnLibsWithTags: ['type:util', 'type:testing-unit'],
},
{
sourceTag: 'type:e2e',
onlyDependOnLibsWithTags: ['type:util', 'type:testing-e2e'],
},
{
sourceTag: 'type:testing-e2e',
onlyDependOnLibsWithTags: [],
},
{
sourceTag: 'type:testing-unit',
onlyDependOnLibsWithTags: ['type:util', 'type:ui'],
},
{
sourceTag: 'type:workspace',
onlyDependOnLibsWithTags: [],
},
];
/**
* Nrwl nx module boudary rules.
*/
exports.nxModuleBoundaryRules = {
enforceBuildableLibDependency: true,
allow: [],
depConstraints: [...workspaceConstraints, ...sharedConstraints, ...clientConstraints, ...backendConstraints, ...typeConstraints],
};