-
-
Notifications
You must be signed in to change notification settings - Fork 773
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
150 lines (148 loc) · 5.3 KB
/
Copy pathoxlint.config.ts
File metadata and controls
150 lines (148 loc) · 5.3 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
import { defineConfig } from "oxlint";
export default defineConfig({
plugins: ["eslint", "typescript", "react", "unicorn", "oxc"],
jsPlugins: ["./scripts/oxlint-plugin-openstatus.js"],
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",
// Vendored from the data-table-filters shadcn registry — reformatting or
// hand-patching these makes the next `shadcn add` a merge conflict.
"packages/ui/src/components/data-table-filters/**",
"packages/ui/src/lib/data-table-filters/**",
"apps/dashboard/src/lib/react-table.d.ts",
"packages/ui/src/react-table.d.ts",
"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",
},
},
{
// Behaviour-triggered, not filename-triggered: anything opening a
// transaction in the services layer is a mutation.
files: ["packages/services/src/**/*.ts"],
excludeFiles: ["**/__tests__/**", "**/*.test.ts"],
rules: {
"openstatus/services-mutation-guards": "error",
// apps/workflows runs this on Deno, and it stays Edge-safe by design.
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["node:*"],
message:
"@openstatus/services must stay runtime-agnostic — no node built-ins. Hand-roll the helper (see deepEqual) or move the code to a Node-only package.",
},
],
},
],
},
},
{
files: ["apps/dashboard/src/**/*.tsx", "apps/dashboard/src/**/*.ts"],
rules: {
"openstatus/no-db-barrel-in-client": "error",
},
},
],
});