import { defineConfig } from "oxlint";
import core from "ultracite/oxlint/core";
import react from "ultracite/oxlint/react";
import remix from "ultracite/oxlint/remix";

export default defineConfig({
  extends: [core, react, remix],
  ignorePatterns: [...core.ignorePatterns, "repos/**", "scripts/**"],
  overrides: [
    {
      files: ["**/convex/**/*.ts", "**/convex/**/*.test.ts"],
      rules: {
        "unicorn/filename-case": "off",
        // Convex targets ES2022: no toSorted/at; sequential awaits ensure atomicity
        "unicorn/no-array-sort": "off",
        "no-await-in-loop": "off",
        // Convex query builders use `any` in index callbacks
        "@typescript-eslint/no-explicit-any": "off",
        "@typescript-eslint/no-non-null-assertion": "off",
        "eslint/complexity": "off",
      },
    },
    {
      files: ["**/convex/**/*.test.ts"],
      rules: {
        "unicorn/no-await-expression-member": "off",
        "eslint/require-await": "off",
        "sort-keys": "off",
      },
    },
  ],
});
