import js from '@eslint/js'; import globals from 'globals'; import importX from 'eslint-plugin-import-x'; import reactHooks from 'eslint-plugin-react-hooks'; import reactRefresh from 'eslint-plugin-react-refresh'; import tseslint from 'typescript-eslint'; import { defineConfig, globalIgnores } from 'eslint/config'; export default defineConfig([ globalIgnores(['dist']), { files: ['**/*.{ts,tsx}'], plugins: { 'import-x': importX, }, extends: [ js.configs.recommended, tseslint.configs.recommended, reactHooks.configs.flat.recommended, reactRefresh.configs.vite, ], languageOptions: { globals: globals.browser, }, rules: { 'import-x/order': [ 'error', { groups: ['builtin', 'external', 'internal', 'index'], 'newlines-between': 'always', alphabetize: { order: 'asc', caseInsensitive: true, }, }, ], 'react-hooks/set-state-in-effect': 'off', 'react-refresh/only-export-components': 'warn', '@typescript-eslint/no-unused-expressions': 'off', '@typescript-eslint/only-throw-error': 'off', 'preserve-caught-error': 'off', }, }, { files: ['**/components/ui/**/*.{ts,tsx}'], rules: { '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unused-vars': 'off', 'react-refresh/only-export-components': 'off', 'import-x/order': 'off', }, }, ]);