|
| 1 | +/* ESLint 8 (eslintrc format) — matches the `eslint . --ext .ts,.tsx` script. */ |
| 2 | +module.exports = { |
| 3 | + root: true, |
| 4 | + env: { browser: true, node: true, es2022: true }, |
| 5 | + parser: '@typescript-eslint/parser', |
| 6 | + parserOptions: { |
| 7 | + ecmaVersion: 2022, |
| 8 | + sourceType: 'module', |
| 9 | + ecmaFeatures: { jsx: true } |
| 10 | + }, |
| 11 | + plugins: ['@typescript-eslint', 'react', 'react-hooks'], |
| 12 | + extends: [ |
| 13 | + 'eslint:recommended', |
| 14 | + 'plugin:@typescript-eslint/recommended', |
| 15 | + 'plugin:react/recommended', |
| 16 | + 'plugin:react/jsx-runtime', |
| 17 | + 'plugin:react-hooks/recommended' |
| 18 | + ], |
| 19 | + settings: { react: { version: 'detect' } }, |
| 20 | + ignorePatterns: ['node_modules/', 'out/', 'dist/', 'dist-electron/', 'resources/', '.eslintrc.cjs'], |
| 21 | + rules: { |
| 22 | + // The IPC boundary and electron-updater are genuinely untyped; `any` is deliberate there. |
| 23 | + '@typescript-eslint/no-explicit-any': 'off', |
| 24 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 25 | + // TypeScript already checks props. |
| 26 | + 'react/prop-types': 'off', |
| 27 | + 'no-unused-vars': 'off', |
| 28 | + '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], |
| 29 | + // `catch { /* best effort */ }` is a deliberate pattern throughout the services. |
| 30 | + 'no-empty': ['error', { allowEmptyCatch: true }], |
| 31 | + '@typescript-eslint/no-unused-expressions': ['error', { allowTernary: true, allowShortCircuit: true }], |
| 32 | + // Dependency arrays are hand-tuned in several hooks; surface as guidance, not failure. |
| 33 | + 'react-hooks/exhaustive-deps': 'warn', |
| 34 | + // Terminal code parses OSC/ANSI sequences — control chars in regexes are the point. |
| 35 | + 'no-control-regex': 'off', |
| 36 | + // Lazy `require()` in the main process is deliberate (platform-gated, optional deps). |
| 37 | + '@typescript-eslint/no-var-requires': 'off', |
| 38 | + // The codebase writes defensive leading semicolons (`;(expr).method()`). |
| 39 | + 'no-extra-semi': 'off', |
| 40 | + // guacamole-lite's types come from shims.d.ts; `@ts-expect-error` would be "unused" |
| 41 | + // there and break typecheck. Allow a described `@ts-ignore` instead. |
| 42 | + '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': 'allow-with-description' }] |
| 43 | + } |
| 44 | +} |
0 commit comments