import js from "@eslint/js"; import globals from "globals"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; import tseslint from "typescript-eslint"; import prettier from "eslint-config-prettier"; // Flat config for the agent-team dashboard SPA (Vite + React + TS). Lints the // `src/` tree only; build/test config files are excluded. `eslint-config-prettier` // is applied LAST so Prettier owns all formatting (no rule conflicts with // `format:check`). export default tseslint.config( { ignores: [ "dist", "coverage", "node_modules", "playwright-report", "test-results", ], }, { files: ["src/**/*.{ts,tsx}"], extends: [js.configs.recommended, ...tseslint.configs.recommended], languageOptions: { ecmaVersion: 2022, globals: globals.browser, }, plugins: { "react-hooks": reactHooks, "react-refresh": reactRefresh, }, rules: { ...reactHooks.configs.recommended.rules, "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, ], }, }, { // shadcn/ui primitives intentionally co-export their `cva` variants // (e.g. `buttonVariants`) alongside the component — the documented pattern; // they are static library primitives, not HMR-sensitive app screens. files: ["src/components/ui/**/*.{ts,tsx}"], rules: { "react-refresh/only-export-components": "off", }, }, prettier, );