-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.json
More file actions
116 lines (115 loc) · 4.67 KB
/
Copy path.eslintrc.json
File metadata and controls
116 lines (115 loc) · 4.67 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
"ignorePatterns": ["**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build", "custom-build"], // add non standard build target names
"checkMissingDependencies": true, // toggle to disable
"checkObsoleteDependencies": true, // toggle to disable
"checkVersionMismatches": true, // toggle to disable
"ignoredDependencies": ["lodash"], // these libs will be omitted from checks
"ignoredFiles": ["webpack.config.js", "eslint.config.js"], // list of files that should be skipped for check
"includeTransitiveDependencies": true, // collect dependencies transitively from children
"useLocalPathsForWorkspaceDependencies": true // toggle to disable
}
],
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints":[
/* --- PLATFORM BOUNDARIES (The "Environment" Safeguard) --- */
{
"sourceTag": "platform:node",
"bannedExternalImports": ["react"],
"notDependOnLibsWithTags": ["platform:browser"]
// "message": "🚫 SERVER ERROR: You cannot import Browser-specific code (DOM/window) into a Node.js library."
},
{
"sourceTag": "platform:browser",
"notDependOnLibsWithTags": ["platform:node"]
// "message": "🚫 BUNDLE ERROR: You cannot import Node-specific code (fs/path/resolvers) into a Browser bundle."
},
{
"sourceTag": "platform:shared",
"bannedExternalImports": ["react"],
"notDependOnLibsWithTags": ["platform:browser", "platform:node"]
// "message": "🚫 PURITY ERROR: Shared libraries must remain environment-agnostic (No DOM, no Node internals)."
},
/* --- LAYER BOUNDARIES (The "Architectural" Safeguard) --- */
{
"sourceTag": "layer:shared",
"onlyDependOnLibsWithTags": ["layer:shared", "layer:test-logic"]
},
{
"sourceTag": "layer:logic",
"bannedExternalImports": ["react"],
"onlyDependOnLibsWithTags": ["layer:shared", "layer:test-logic"]
},
{
"sourceTag": "layer:tokens",
"onlyDependOnLibsWithTags": ["layer:shared"]
},
{
"sourceTag": "layer:data",
"bannedExternalImports": ["react"],
"onlyDependOnLibsWithTags": ["layer:logic", "layer:shared", "layer:test-logic"]
},
{
"sourceTag": "layer:ui-primitives",
"onlyDependOnLibsWithTags": ["layer:tokens", "layer:shared", "layer:test-ui"]
},
{
"sourceTag": "layer:ui-composites",
"onlyDependOnLibsWithTags": ["layer:ui-primitives", "layer:tokens", "layer:test-ui"]
},
{
"sourceTag": "layer:components",
"onlyDependOnLibsWithTags": ["layer:ui-composites", "layer:data", "layer:logic", "layer:test-ui"]
},
{
"sourceTag": "layer:workflows",
"onlyDependOnLibsWithTags": ["layer:components", "layer:ui-composites", "layer:logic", "layer:test-ui"]
},
{
"sourceTag": "layer:ai",
"onlyDependOnLibsWithTags": ["layer:data", "layer:shared"]
},
{
"sourceTag": "layer:entrypoints",
"onlyDependOnLibsWithTags": ["layer:workflows", "layer:logic", "layer:data", "layer:shared"]
},
{
"sourceTag": "layer:test-logic",
"bannedExternalImports": ["react"],
"onlyDependOnLibsWithTags": ["layer:shared"]
},
{
"sourceTag": "layer:test-ui",
"onlyDependOnLibsWithTags": ["layer:test-logic", "layer:shared", "layer:ui-primitives"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/prefer-optional-chain": ["error", {
"allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing": true
}]
}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
],
"extends": ["./.eslintrc.base.json"]
}