// Lint rules for the frontend (FLAW-19): real mistakes are errors, style is left to the code. import js from '@eslint/js'; import globals from 'globals'; import reactHooks from 'eslint-plugin-react-hooks'; import tseslint from 'typescript-eslint'; export default tseslint.config( { ignores: ['dist', 'node_modules', 'coverage'] }, { files: ['src/**/*.{ts,tsx}'], extends: [js.configs.recommended, ...tseslint.configs.recommended], languageOptions: { ecmaVersion: 2022, globals: globals.browser, }, plugins: { 'react-hooks': reactHooks }, rules: { ...reactHooks.configs.recommended.rules, // Error payloads and browser APIs without types are handled as any on purpose '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrors: 'none' }], 'no-empty': ['error', { allowEmptyCatch: true }], }, }, { files: ['public/sw.js'], languageOptions: { globals: globals.serviceworker }, extends: [js.configs.recommended], }, );