-
Notifications
You must be signed in to change notification settings - Fork 1
/
config-backend.js
133 lines (133 loc) · 4.25 KB
/
config-backend.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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
module.exports = {
extends: ['./config-base.js'],
env: {
node: true,
mongo: true,
},
rules: {
'node/no-unpublished-require': 'warn',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-restricted-imports': [
'error',
{
paths: [
{
name: 'lodash',
message: "Please use `import [package] from 'lodash/[package]'` instead.",
},
],
patterns: ['!lodash/*'],
},
],
'import/no-restricted-paths': [
'error',
{
zones: [
{
target: './src/domain',
from: './src/infrastructure',
except: ['./repositories/repository-compatibility-interfaces.ts'],
message: 'Hex Arch - Cannot import from infrastructure in the domain layer',
},
{
target: './src/domain',
from: './src/application',
message: 'Hex Arch - Cannot import from application in the domain layer',
},
{
target: './src/application',
from: './src/infrastructure',
message: 'Hex Arch - Cannot import from infrastructure in the application layer',
},
{
target: './src/infrastructure',
from: './src/application',
message: 'Hex Arch - Cannot import from application in the infrastructure layer',
},
{
target: './src',
from: './test',
message: 'Test code - Cannot import test code into src',
},
{
target: './test/domain',
from: './src/infrastructure',
message: 'Hex: domain layer cannot know about the infrastructure layer, even in tests',
},
{
target: './test/domain',
from: './src/application',
message: 'Hex: domain layer cannot know about the application layer, even in tests',
},
{
target: './test/infrastructure',
from: './src/application',
message: 'Hex: infrastructure layer cannot know about the application layer, even in tests',
},
{
target: './test/application',
from: './src/infrastructure',
message: 'Hex: application layer cannot know about the infrastructure layer, even in tests',
},
],
},
],
},
overrides: [
{
files: ['./src/domain/**/*'],
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
name: '@neofinancial/neo-framework',
importNames: ['!BaseRepositoryPort'],
message: 'Hex: domain layer cannot know infrastructure details (MongoDB)',
},
{
name: 'mongodb',
message: 'Hex: domain layer cannot know infrastructure details (MongoDB)',
},
{
name: 'mongoose',
message: 'Hex: domain layer cannot know infrastructure details (MongoDB)',
},
{
name: '@neofinancial/neo-queue',
message: 'Hex: domain layer cannot know infrastructure details (queues)',
},
{
name: 'aws-sdk',
message: 'Hex: domain layer cannot know infrastructure details (AWS)',
},
{
name: '@neofinancial/neo-qldb',
message: 'Hex: domain layer cannot know infrastructure details (QLDB)',
},
{
name: '@neofinancial/neo-redis-client',
message: 'Hex: domain layer cannot know infrastructure details (Redis)',
},
{
name: '@neofinancial/neo-s3',
message: 'Hex: domain layer cannot know infrastructure details (S3)',
},
{
name: '@neofinancial/neo-elasticsearch',
message: 'Hex: domain layer cannot know infrastructure details (Elasticsearch)',
},
],
},
},
{
files: ['**/migrations/**/*'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'autofix/no-unused-vars': 'off',
'import/no-extraneous-dependencies': 'off',
'no-console': 'off',
},
},
],
};