import js from '@eslint/js'; import prettier from 'eslint-config-prettier'; import importPlugin from 'eslint-plugin-import'; import jsxA11y from 'eslint-plugin-jsx-a11y'; import reactHooks from 'eslint-plugin-react-hooks'; import globals from 'globals'; import tseslint from 'typescript-eslint'; export default tseslint.config( { ignores: [ 'public', 'dist', 'node_modules', 'bin', 'assets', '*.config.{js,mjs,cjs,ts}', ], }, js.configs.recommended, ...tseslint.configs.recommended, jsxA11y.flatConfigs.recommended, { files: ['src/**/*.{ts,tsx}'], plugins: { 'react-hooks': reactHooks, import: importPlugin, }, languageOptions: { globals: { ...globals.browser, ...globals.node, __DEV__: 'readonly', __VERSION__: 'readonly', }, parserOptions: { ecmaFeatures: { jsx: true }, }, }, rules: { '@typescript-eslint/no-empty-object-type': 'off', 'no-empty': ['error', { allowEmptyCatch: true }], '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/no-explicit-any': 'off', 'no-use-before-define': 'off', '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_', caughtErrors: 'none' }, ], '@typescript-eslint/no-unused-expressions': [ 'error', { allowShortCircuit: true, allowTernary: true }, ], '@typescript-eslint/no-use-before-define': ['error', { functions: false }], '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/ban-ts-comment': 'off', 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'warn', 'import/order': [ 'error', { groups: [ 'builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type', ], pathGroups: [{ pattern: '~/**', group: 'internal', position: 'after' }], pathGroupsExcludedImportTypes: ['builtin'], alphabetize: { order: 'asc', caseInsensitive: true }, 'newlines-between': 'always', }, ], }, }, prettier, );