-
-
Notifications
You must be signed in to change notification settings - Fork 730
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
115 lines (113 loc) 路 3.97 KB
/
Copy pathoxlint.config.ts
File metadata and controls
115 lines (113 loc) 路 3.97 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
import { defineConfig } from "oxlint";
export default defineConfig({
plugins: ["eslint", "typescript", "react", "unicorn", "oxc"],
categories: {
correctness: "warn",
},
rules: {
// Kept off for parity with the previous Biome config.
"react/no-array-index-key": "off", // biome suspicious/noArrayIndexKey
"no-case-declarations": "off", // biome correctness/noSwitchDeclarations
// No oxlint equivalent, so dropped: biome performance/noAccumulatingSpread,
// complexity/noForEach, a11y/noSvgWithoutTitle, a11y/useAltText,
// a11y/useKeyWithClickEvents. Their suppressions are removed.
// Mirror Biome's recommended set. Existing violations are suppressed in-code.
"no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrors: "none",
},
],
"typescript/no-explicit-any": "error",
"typescript/no-non-null-assertion": "error",
"react/no-danger": "error",
"react/exhaustive-deps": "warn",
"unicorn/prefer-node-protocol": "error",
},
ignorePatterns: [
"packages/ui/src/components/*.ts",
"packages/ui/src/components/*.tsx",
"apps/dashboard/src/scripts/*.ts",
"packages/proto/gen/**",
"**/*_pb.ts",
"**/drizzle/meta/**",
"**/.content-collections/**",
".devbox/**",
"**/*.astro",
],
overrides: [
{
// Ban @openstatus/db + drizzle imports in layers migrated onto
// @openstatus/services. Scope grows one domain per migration PR.
files: [
"packages/api/src/router/statusReport.ts",
"packages/api/src/router/maintenance.ts",
"packages/api/src/router/incident.ts",
"packages/api/src/router/monitor.ts",
"packages/api/src/router/pageComponent.ts",
"packages/api/src/router/page.ts",
"packages/api/src/router/workspace.ts",
"packages/api/src/router/user.ts",
"packages/api/src/router/invitation.ts",
"packages/api/src/router/apiKey.ts",
"packages/api/src/router/import.ts",
"apps/server/src/routes/rpc/handlers/health/**",
"apps/server/src/routes/rpc/handlers/status-report/**",
"apps/server/src/routes/rpc/handlers/maintenance/**",
"apps/server/src/routes/rpc/handlers/notification/**",
"apps/server/src/routes/slack/interactions.ts",
],
excludeFiles: [
"**/__tests__/**",
"**/*.test.ts",
// Still read db directly: limits.ts queries quotas, converters.ts needs
// db enum shapes for proto round-trip. Exempt until they move to services.
"apps/server/src/routes/rpc/handlers/notification/limits.ts",
"apps/server/src/routes/rpc/handlers/notification/converters.ts",
],
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
name: "@openstatus/db",
message:
"Use @openstatus/services instead (domain has migrated to the service layer).",
},
{
name: "@openstatus/db/src/schema",
message: "Use @openstatus/services instead.",
},
{
name: "@openstatus/db/src/schema/plan/utils",
message: "Use @openstatus/services instead.",
},
{
name: "@openstatus/db/src/schema/plan/schema",
message: "Use @openstatus/services instead.",
},
{
name: "@openstatus/db/src/schema/plan/config",
message: "Use @openstatus/services instead.",
},
{
name: "drizzle-orm",
message: "Use @openstatus/services instead.",
},
],
},
],
},
},
{
// Tests legitimately use `any` for spies/fixtures.
files: ["**/*.test.ts", "**/__tests__/**"],
rules: {
"typescript/no-explicit-any": "off",
},
},
],
});