-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
112 lines (105 loc) · 2.64 KB
/
Copy patheslint.config.mjs
File metadata and controls
112 lines (105 loc) · 2.64 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
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
// Global ignores
{
ignores: ['dist/', 'node_modules/', 'coverage/', '*.config.*'],
},
// Layer constraint: cli/ cannot import from lib/
{
files: ['src/cli/**/*.ts'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['../lib/*', '../../lib/*', '../lib', '../../lib'],
message:
'CLI layer cannot import from lib/ directly. Use services/ layer instead.',
},
],
},
],
},
},
// Layer constraint: services/ cannot import from cli/
{
files: ['src/services/**/*.ts'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: ['../cli/*', '../../cli/*', '../cli', '../../cli'],
message:
'Services layer cannot import from cli/. Services must remain CLI-framework agnostic.',
},
],
},
],
},
},
// Layer constraint: lib/ cannot import from services/ or cli/
{
files: ['src/lib/**/*.ts'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: [
'../services/*',
'../../services/*',
'../services',
'../../services',
'../cli/*',
'../../cli/*',
'../cli',
'../../cli',
],
message:
'Lib layer cannot import from services/ or cli/. Lib must contain stateless pure functions only.',
},
],
},
],
},
},
// Layer constraint: types/ cannot import from any other layer
{
files: ['src/types/**/*.ts'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: [
'../cli/*',
'../../cli/*',
'../cli',
'../../cli',
'../services/*',
'../../services/*',
'../services',
'../../services',
'../lib/*',
'../../lib/*',
'../lib',
'../../lib',
],
message:
'Types layer cannot import from any other layer. Types must have zero dependencies.',
},
],
},
],
},
},
);