import js from '@eslint/js' 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 tseslint.config( { ignores: ['dist/**', 'dist-electron/**', 'node_modules/**', 'release/**', 'runtime/**'], }, js.configs.recommended, ...tseslint.configs.recommended, { files: ['**/*.{js,cjs}'], languageOptions: { globals: globals.node, sourceType: 'commonjs', }, rules: { '@typescript-eslint/no-require-imports': 'off', }, }, { files: ['**/*.{ts,tsx}'], languageOptions: { ecmaVersion: 2022, globals: { ...globals.browser, ...globals.node, }, }, plugins: { 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, rules: { 'no-undef': 'off', '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_', varsIgnorePattern: '^_', }, ], 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'warn', 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], }, }, )