import js from '@eslint/js' import { defineConfig } from 'eslint/config' import jsxA11y from 'eslint-plugin-jsx-a11y' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' import globals from 'globals' import tseslint from 'typescript-eslint' export default defineConfig( { ignores: ['dist', 'dist-ssr', 'node_modules'] }, js.configs.recommended, tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, reactHooks.configs.flat['recommended-latest'], jsxA11y.flatConfigs.recommended, { files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 2023, globals: globals.browser, parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, }, }, plugins: { 'react-refresh': reactRefresh, }, rules: { 'react-refresh/only-export-components': [ 'error', { allowConstantExport: true }, ], '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_', }, ], '@typescript-eslint/consistent-type-imports': [ 'error', { prefer: 'type-imports', fixStyle: 'inline-type-imports' }, ], '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/no-misused-promises': 'error', 'no-console': ['error', { allow: ['warn', 'error'] }], eqeqeq: ['error', 'always', { null: 'ignore' }], 'prefer-const': 'error', 'no-var': 'error', 'object-shorthand': 'error', }, }, { files: ['src/components/tui/hero-terminal.tsx'], rules: { 'jsx-a11y/no-noninteractive-tabindex': 'off', 'jsx-a11y/no-noninteractive-element-interactions': 'off', }, }, { files: ['*.config.ts', 'scripts/**/*.ts'], languageOptions: { globals: globals.node, }, rules: { 'no-console': 'off', '@typescript-eslint/no-unsafe-assignment': 'off', }, }, { files: ['src/entry-server.tsx'], rules: { 'react-refresh/only-export-components': 'off', }, }, )