import nextPlugin from "@next/eslint-plugin-next";
import oxlint from "eslint-plugin-oxlint";

// ESLint runs only for what Oxlint does not cover: the full Next plugin lives
// here, and the configs below switch off every rule Oxlint already checked, so
// nothing is linted twice.
export default [
  // Build output is not source. Flat config has no implicit ignores beyond
  // node_modules, so without this ESLint reports on Turbopack's own chunks.
  // `components/ui` is written by `shadcn add`, not by us: linting it only
  // reports on code the next CLI run would overwrite anyway.
  { ignores: [".next/**", "dist/**", "build/**", "drizzle/**", "components/ui/**"] },
  {
    plugins: { "@next/next": nextPlugin },
    rules: {
      ...nextPlugin.configs.recommended.rules,
      ...nextPlugin.configs["core-web-vitals"].rules,
    },
  },
  ...oxlint.configs["flat/recommended"],
  ...oxlint.configs["flat/nextjs"],
  ...oxlint.configs["flat/react"],
  ...oxlint.configs["flat/typescript"],
];
