import js from '@eslint/js'; import globals from 'globals'; import react from 'eslint-plugin-react'; import reactHooks from 'eslint-plugin-react-hooks'; import reactRefresh from 'eslint-plugin-react-refresh'; import tseslint from 'typescript-eslint'; export default tseslint.config( { ignores: ['dist', 'node_modules'], }, { files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 'latest', globals: { ...globals.browser, ...globals.node, ...globals.es2021, }, parser: tseslint.parser, parserOptions: { ecmaFeatures: { jsx: true, }, sourceType: 'module', project: ['./tsconfig.json', './tsconfig.node.json'], }, }, plugins: { '@typescript-eslint': tseslint.plugin, react, 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, settings: { react: { version: 'detect', }, }, rules: { ...js.configs.recommended.rules, ...tseslint.configs.recommended.rules, ...react.configs.recommended.rules, ...reactHooks.configs.recommended.rules, 'max-len': [ 'error', { code: 120, tabWidth: 2, ignoreUrls: true, ignoreStrings: true, ignoreTemplateLiterals: true, ignoreComments: true, }, ], 'react/react-in-jsx-scope': 'off', 'react/no-unescaped-entities': [ 'error', { forbid: ['>', '}'], }, ], '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/no-explicit-any': 'warn', '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, ], 'react-hooks/exhaustive-deps': 'warn', 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], }, }, { files: ['**/Help.tsx', '**/Dashboard.tsx'], rules: { 'react/no-unescaped-entities': 'off', }, }, );