import js from "@eslint/js"; import { defineConfig, globalIgnores } from "eslint/config"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; import globals from "globals"; import tseslint from "typescript-eslint"; import eslintConfigPrettier from "eslint-config-prettier"; export default defineConfig([ globalIgnores(["dist", "src/api/generated", "src/components/ui"]), { files: ["**/*.{ts,tsx}"], extends: [ js.configs.recommended, tseslint.configs.recommended, reactHooks.configs["recommended-latest"], reactRefresh.configs.vite, ], languageOptions: { ecmaVersion: 2020, globals: globals.browser, }, rules: { "react-refresh/only-export-components": ["error", { allowConstantExport: true }], }, }, { files: ["src/contexts/**/*.{ts,tsx}", "src/providers/**/*.{ts,tsx}"], rules: { "react-refresh/only-export-components": "warn", }, }, eslintConfigPrettier, ]);