import js from '@eslint/js' import globals from 'globals' import tseslint from 'typescript-eslint' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' export default tseslint.config( { ignores: ['dist', 'playwright-report', 'test-results'] }, // App source + tests: TypeScript + React, browser globals. { files: ['**/*.{ts,tsx}'], extends: [js.configs.recommended, ...tseslint.configs.recommended], languageOptions: { ecmaVersion: 2022, globals: globals.browser, }, plugins: { 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, rules: { // Stable, battle-tested hooks rules (the newer plugin's `recommended` // also ships experimental rules that false-positive on legitimate // reset-state-on-open patterns, so enable the classic two explicitly). 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'warn', 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], // The codebase intentionally avoids `any` (see CLAUDE.md); keep that enforced. '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }], }, }, // Config / Node-side files: Node globals (e.g. __dirname in vite.config.ts). { files: ['*.config.{ts,js}', 'vite.config.ts', 'playwright.config.ts'], languageOptions: { globals: globals.node, }, }, )