import { dirname } from "path"; import { fileURLToPath } from "url"; import { FlatCompat } from "@eslint/eslintrc"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const compat = new FlatCompat({ baseDirectory: __dirname, }); const eslintConfig = [ ...compat.extends("next/core-web-vitals", "next/typescript", "prettier"), { rules: { "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/no-unused-vars": [ "error", { argsIgnorePattern: "^_" }, ], }, }, { // Tests assert response shape via expect() — narrowing every // `res.json()` to a structural type adds boilerplate without catching // bugs. Allow `any` casts at JSON boundaries in test files. files: ["tests/**/*.ts", "tests/**/*.tsx"], rules: { "@typescript-eslint/no-explicit-any": "off", }, }, { ignores: ["client-portal/**", "next-env.d.ts"], }, ]; export default eslintConfig;