-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbiome.jsonc
More file actions
207 lines (207 loc) · 5.18 KB
/
Copy pathbiome.jsonc
File metadata and controls
207 lines (207 loc) · 5.18 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
{
"$schema": "https://biomejs.dev/schemas/2.4.6/schema.json",
"plugins": [
"./biome-plugins/no-parens-await.grit",
"./biome-plugins/no-template-log-msg.grit"
],
"files": {
"includes": [
"**",
// excludes
"!**/coverage",
"!**/dist",
"!**/node_modules",
"!.ignored",
"!.lavish",
"!biome-plugins"
]
},
"javascript": {
"parser": {
// Allow Inversify @inject() on constructor params
"unsafeParameterDecoratorsEnabled": true
}
},
"linter": {
"rules": {
"recommended": true,
"complexity": {
// Cognitive complexity over the default threshold means split the function
"noExcessiveCognitiveComplexity": "error"
},
"suspicious": {
// No explicit any; use unknown and narrow
"noExplicitAny": "error",
// No console.* in source; use the log wrapper
"noConsole": "error",
// No @ts-ignore / @ts-nocheck; use ts-expect-error with a reason
"noTsIgnore": "error"
},
"style": {
// Block direct process.env access; route through env.ts
"noProcessEnv": "error",
// Ban the non-null `!` assertion
"noNonNullAssertion": "error",
// Never reassign a function parameter
"noParameterAssign": "error",
// Named exports only. Default exports can't be barrel re-exported by name
"noDefaultExport": "error",
// Consistent identifier casing (acronyms like DTO/URL stay as one word)
"useNamingConvention": {
"level": "error",
"options": {
"strictCase": false,
"conventions": [
// Error codes read as constants, not type names
{
"selector": { "kind": "enumMember" },
"formats": ["CONSTANT_CASE"]
}
]
}
},
// Require `import type` for type-only imports (pairs with verbatimModuleSyntax)
"useImportType": "error",
// Filenames: kebab-case or camelCase, no PascalCase
"useFilenamingConvention": {
"level": "error",
"options": { "filenameCases": ["kebab-case", "camelCase"] }
},
"noRestrictedImports": {
"level": "error",
"options": {
"paths": {
// Reserve `pinoInstance` for pino-http config
"~/logger": {
"importNames": ["pinoInstance"],
"message": "Use `log` for application code. `pinoInstance` is reserved for pino-http config."
},
// Force zod, pino, pino-pretty through the @thoth/utils wrappers
"zod": {
"message": "Use `z` from @thoth/utils (has .openapi())."
},
"pino": { "message": "Use `log` from @thoth/utils." },
"pino-pretty": {
"message": "Wired inside @thoth/utils createLogger; don't import directly."
}
},
"patterns": [
// Force cross-folder imports through the folder's index.ts barrel
{
"group": ["~/*/**", "!~/**/index"],
"message": "Cross-folder imports must go through the folder's index.ts barrel."
},
// Block relative parent imports that leave the current module
{
"group": ["../../**"],
"message": "Use `~/` (src) or `@thoth/*` (workspaces) instead of `../../`."
}
]
}
}
}
}
},
"overrides": [
{
// Only env.ts files may access process.env directly, and no envalid defaults
"includes": ["**/src/env.ts"],
"plugins": ["./biome-plugins/no-envalid-default.grit"],
"linter": {
"rules": {
"style": {
"noProcessEnv": "off",
// Keys must match the real variable names, which are SCREAMING_SNAKE_CASE
"useNamingConvention": "off"
}
}
}
},
{
// Only wrapper implementation sites may import raw zod/pino.
// Tests may deep-import src for unit isolation.
"includes": [
"**/src/infrastructure/http/pino-http-options.ts",
"**/packages/utils/src/**",
"**/test/**",
"**/*.spec.ts"
],
"linter": {
"rules": {
"style": {
"noRestrictedImports": "off"
}
}
}
},
{
// Scripts may use console for output.
"includes": ["**/scripts/**"],
"linter": {
"rules": {
"suspicious": {
"noConsole": "off"
}
}
}
},
{
// Mocks name properties after the real export they replace (e.g. a class).
"includes": ["**/test/**", "**/*.spec.ts"],
"linter": {
"rules": {
"style": {
"useNamingConvention": "off"
}
}
}
},
{
// Build tool configs require a default export.
"includes": ["**/*.config.ts"],
"linter": {
"rules": {
"style": {
"noDefaultExport": "off"
}
}
}
},
{
// authorization_servers is an OAuth spec (RFC 9728) field name, not ours to rename
"includes": ["**/auth.controller.ts"],
"linter": {
"rules": {
"style": {
"useNamingConvention": "off"
}
}
}
},
{
// DI may import barrels and infrastructure adapters, nothing else in a module.
"includes": ["**/src/di/**"],
"linter": {
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"patterns": [
{
"group": [
"~/*/**",
"!~/**/index",
"!~/modules/*/infrastructure/**"
],
"message": "DI may import barrels and infrastructure adapters only."
}
]
}
}
}
}
}
}
]
}