import js from '@eslint/js' import tseslint from 'typescript-eslint' import reactPlugin from 'eslint-plugin-react' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' import prettierConfig from 'eslint-config-prettier' export default tseslint.config( { linterOptions: { reportUnusedDisableDirectives: 'off', }, }, js.configs.recommended, ...tseslint.configs.strict, ...tseslint.configs.stylistic, { files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 2022, parser: tseslint.parser, parserOptions: { project: './tsconfig.json', ecmaFeatures: { jsx: true, }, }, }, plugins: { react: reactPlugin, 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, rules: { ...reactPlugin.configs.recommended.rules, ...reactHooks.configs.recommended.rules, // Temporarily relaxed while migrating to compiler-compatible hook patterns. 'react-hooks/preserve-manual-memoization': 'off', 'react-hooks/set-state-in-effect': 'off', 'react-hooks/exhaustive-deps': 'off', 'react-refresh/only-export-components': 'off', 'react/react-in-jsx-scope': 'off', 'react/prop-types': 'off', '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', }, ], '@typescript-eslint/consistent-type-imports': [ 'error', { prefer: 'type-imports', fixStyle: 'inline-type-imports', }, ], '@typescript-eslint/no-import-type-side-effects': 'error', }, settings: { react: { version: 'detect', }, }, }, prettierConfig, { files: ['src/components/ui/**/*.{ts,tsx}', 'src/test/**/*.{ts,tsx}'], rules: { 'react-refresh/only-export-components': 'off', }, }, { files: ['scripts/**/*.{js,mjs}'], languageOptions: { ecmaVersion: 2022, sourceType: 'module', globals: { console: 'readonly', process: 'readonly', Buffer: 'readonly', __dirname: 'readonly', __filename: 'readonly', global: 'readonly', setImmediate: 'readonly', clearImmediate: 'readonly', setTimeout: 'readonly', clearTimeout: 'readonly', setInterval: 'readonly', clearInterval: 'readonly', }, }, rules: { 'no-console': 'off', '@typescript-eslint/no-unused-vars': 'off', }, }, { ignores: [ 'dist/**', 'src-tauri/dist/**', 'node_modules/**', 'src-tauri/target/**', 'src-tauri/gen/**', 'e2e/**', '*.config.js', '*.config.ts', 'vite.config.ts', 'vite.config.d.ts', 'tailwind.config.js', ], } )