Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
openstatus oxlint.config.ts
5.4 kB ยท 150 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151import { 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", }, }, ],});