forked from MoonshotAI/kimi-code
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.oxlintrc.json
More file actions
242 lines (241 loc) · 8.33 KB
/
Copy path.oxlintrc.json
File metadata and controls
242 lines (241 loc) · 8.33 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"categories": {
"correctness": "error",
"suspicious": "warn",
"pedantic": "warn",
"perf": "warn"
},
"plugins": [
"typescript",
"import",
"unicorn",
"promise",
"node"
],
"rules": {
"eslint/no-useless-return": "off",
"eslint/no-shadow": "off",
"eslint/eqeqeq": "error",
"eslint/no-throw-literal": "off",
"eslint/no-control-regex": "off",
"typescript/no-misused-promises": "error",
"typescript/return-await": "error",
"typescript/only-throw-error": "error",
"import/no-cycle": "error",
"import/no-self-import": "error",
"import/no-unassigned-import": "off",
"unicorn/prefer-node-protocol": "error",
"unicorn/no-useless-undefined": "warn",
"unicorn/no-lonely-if": "off",
"unicorn/no-array-callback-reference": "off",
"typescript/prefer-promise-reject-errors": "off",
"typescript/no-unsafe-function-type": "off",
"typescript/no-unsafe-argument": "off",
"typescript/no-unsafe-assignment": "off",
"typescript/no-unsafe-call": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/no-unsafe-return": "off",
"eslint/no-console": "warn",
"typescript/no-explicit-any": "warn",
"typescript/no-non-null-assertion": "warn",
"typescript/use-unknown-in-catch-callback-variable": "off",
"typescript/consistent-type-imports": "warn",
"typescript/ban-types": "off",
"import/first": "warn",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"ts": "never",
"tsx": "never"
}
],
"import/no-duplicates": "warn",
"import/no-mutable-exports": "warn",
"eslint/no-restricted-imports": [
"error",
{
"paths": [
{
"name": "undici",
"message": "Bun resolves bare 'undici' to its built-in stub ahead of node_modules (oven-sh/bun#38840); import from the package-local undici-npm compat module instead."
}
]
}
],
"unicorn/error-message": "warn",
"unicorn/throw-new-error": "warn",
"unicorn/catch-error-name": "warn",
"unicorn/prefer-add-event-listener": "off",
"node/no-new-require": "warn",
"node/no-path-concat": "warn",
"promise/no-callback-in-promise": "warn",
"promise/valid-params": "warn",
"promise/no-return-in-finally": "warn",
"promise/always-return": "warn",
"eslint/max-classes-per-file": "off",
"eslint/max-depth": "off",
"eslint/max-lines": "off",
"eslint/max-lines-per-function": "off",
"eslint/max-nested-callbacks": "off",
"eslint/no-warning-comments": "off",
"eslint/no-inline-comments": "off",
"eslint/no-negated-condition": "off",
"eslint/no-await-in-loop": "off",
"eslint/require-await": "warn",
"typescript/require-await": "warn",
"eslint/sort-vars": "off",
"eslint/radix": "off",
"eslint/symbol-description": "off",
"typescript/consistent-return": "off",
"unicorn/consistent-function-scoping": "off",
"typescript/no-deprecated": "off",
"typescript/no-unsafe-type-assertion": "off",
"typescript/strict-boolean-expressions": "off",
"typescript/no-duplicate-type-constituents": "off",
"import/max-dependencies": "off"
},
"overrides": [
{
"files": [
"**/examples/**/*.ts",
"**/examples/**/*.tsx"
],
"rules": {
"eslint/no-console": "off"
}
},
{
// The worker closures: these modules (and everything
// packages/minidb/src/worker/ and
// packages/kap-server/src/search/worker/ pull in) are loaded by a bare
// node:worker_threads Worker under Node's native type stripping with
// `execArgv: ['--experimental-transform-types']`, which requires
// explicit `.ts` import specifiers (the strip loader does not remap
// `.js` -> `.ts`). Keep the exception scoped to exactly those closures.
"files": [
"packages/minidb/src/worker/**/*.ts",
"packages/minidb/src/codec.ts",
"packages/minidb/src/crc32.ts",
"packages/minidb/src/trigram.ts",
"packages/minidb/src/text-postings.ts",
"packages/minidb/src/text-index/tokenize.ts",
"packages/minidb/src/gen-codec.ts",
"packages/kap-server/src/search/worker/**/*.ts",
"packages/kap-server/src/search/indexCore.ts",
"packages/kap-server/src/search/match.ts"
],
"rules": {
"import/extensions": "off"
}
},
{
"files": [
"packages/agent-core-v2/src/app/workflow/**/*.ts"
],
"rules": {
// `?raw` imports of the builtin .js workflow scripts: oxlint resolves
// the specifier as a module and reports `default`/`extensions` errors
// that do not apply to raw string imports.
"import/default": "off",
"import/extensions": "off"
}
},
{
"files": [
"packages/agent-core-v2/src/_base/di/cascadeEngine.ts",
"packages/oauth/src/oauth-token-transaction.ts",
"packages/kaos/**/*.ts"
],
"rules": {
// oxlint 1.59's no-useless-undefined misfires on REQUIRED parameters
// typed `T | undefined` / `unknown` (e.g. `_setUnitState(..., error)`
// or `adopt(undefined)`), and `--fix` then strips the argument,
// producing TS2554. Keep explicit `undefined` in those call sites.
"unicorn/no-useless-undefined": "off"
}
},
{
"files": [
"packages/kosong/src/providers/**/*.ts"
],
"rules": {
"typescript/no-unsafe-argument": "off",
"typescript/no-unsafe-assignment": "off",
"typescript/no-unsafe-call": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/no-unsafe-return": "off",
// Provider-layer degradation diagnostics (media placeholders, native
// fast-path fallbacks) intentionally warn via console: the package is
// the lowest wire layer and has no logger dependency to route through.
"eslint/no-console": "off"
}
},
{
"files": [
"**/*.test.ts",
"**/*.test.tsx",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/test/**/*.ts",
"**/test/**/*.tsx"
],
"plugins": [
"vitest"
],
"rules": {
"typescript/no-explicit-any": "off",
"typescript/no-unsafe-assignment": "off",
"typescript/no-unsafe-argument": "off",
"typescript/no-non-null-assertion": "off",
"typescript/unbound-method": "off",
"typescript/no-redundant-type-constituents": "off",
"eslint/no-console": "off",
"eslint/no-promise-executor-return": "off",
"typescript/no-unsafe-member-access": "off",
"vitest/require-mock-type-parameters": "off",
"eslint/no-shadow": "off",
"unicorn/prefer-event-target": "off",
"jest/no-disabled-tests": "off",
"vitest/no-disabled-tests": "off",
"eslint/no-control-regex": "off",
"eslint/no-unused-vars": "off",
"eslint/no-unsafe-optional-chaining": "off",
"jest/valid-expect": "off",
// Tests legitimately throw non-Error values to verify defensive
// catch-all handlers (e.g. safelyCallListener).
"typescript/only-throw-error": "off",
"unicorn/no-useless-spread": "off",
// oxlint 1.59 misfires on REQUIRED parameters typed `T | undefined`
// (e.g. `Promise.resolve(undefined)` for `Promise<CronTask | undefined>`);
// `--fix` strips the argument and breaks the types. Tests use explicit
// `undefined` intentionally in stubs.
"unicorn/no-useless-undefined": "off",
"import/no-cycle": "off",
"typescript/no-meaningless-void-operator": "off",
"typescript/require-array-sort-compare": "off",
"vitest/expect-expect": "error",
"vitest/no-conditional-tests": "error",
"vitest/no-focused-tests": "error",
"vitest/no-identical-title": "error",
"vitest/valid-expect": "off",
"vitest/valid-describe-callback": "error",
"vitest/no-standalone-expect": "error",
"vitest/warn-todo": "off"
}
}
],
"ignorePatterns": [
"dist/",
"dist-web/",
"coverage/",
"node_modules/",
"apps/*/scripts/",
"docs/smoke-archive/",
"packages/pi-tui/",
"*.generated.ts",
"参考目录/"
]
}