|
| 1 | +import js from '@eslint/js'; |
| 2 | +import tsParser from '@typescript-eslint/parser'; |
| 3 | +import tsPlugin from '@typescript-eslint/eslint-plugin'; |
| 4 | +import globals from 'globals'; |
| 5 | + |
| 6 | +export default [ |
| 7 | + js.configs.recommended, |
| 8 | + { |
| 9 | + files: ['src/**/*.ts'], |
| 10 | + languageOptions: { |
| 11 | + parser: tsParser, |
| 12 | + parserOptions: { |
| 13 | + ecmaVersion: 'latest', |
| 14 | + sourceType: 'module', |
| 15 | + }, |
| 16 | + globals: { |
| 17 | + ...globals.node, |
| 18 | + }, |
| 19 | + }, |
| 20 | + plugins: { |
| 21 | + '@typescript-eslint': tsPlugin, |
| 22 | + }, |
| 23 | + rules: { |
| 24 | + // TypeScript recommended rules |
| 25 | + ...tsPlugin.configs.recommended.rules, |
| 26 | + |
| 27 | + // Single quotes with avoid-escape (matching TSLint quotemark) |
| 28 | + // Allow template literals as they're commonly used in the codebase |
| 29 | + quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }], |
| 30 | + |
| 31 | + // Max line length 120 with ignore patterns for imports/exports |
| 32 | + 'max-len': ['error', { |
| 33 | + code: 120, |
| 34 | + ignorePattern: '^import |^export \\{(.*?)\\}|class [a-zA-Z]+ implements |//', |
| 35 | + ignoreUrls: true, |
| 36 | + ignoreStrings: true, |
| 37 | + ignoreTemplateLiterals: true, |
| 38 | + }], |
| 39 | + |
| 40 | + // Trailing commas - disabled to match existing codebase style |
| 41 | + 'comma-dangle': 'off', |
| 42 | + |
| 43 | + // Disabled rules (matching TSLint config) |
| 44 | + 'no-empty': 'off', |
| 45 | + 'no-console': 'off', |
| 46 | + 'no-unused-expressions': 'off', |
| 47 | + '@typescript-eslint/no-unused-expressions': 'off', |
| 48 | + |
| 49 | + // Allow unused vars/params - matching TSLint which didn't enforce this strictly |
| 50 | + '@typescript-eslint/no-unused-vars': 'off', |
| 51 | + |
| 52 | + // Other disabled TypeScript rules |
| 53 | + '@typescript-eslint/no-explicit-any': 'off', |
| 54 | + '@typescript-eslint/no-empty-function': 'off', |
| 55 | + '@typescript-eslint/ban-ts-comment': 'off', |
| 56 | + '@typescript-eslint/no-require-imports': 'off', |
| 57 | + '@typescript-eslint/no-empty-object-type': 'off', |
| 58 | + |
| 59 | + // Disable rules that TypeScript handles |
| 60 | + 'no-undef': 'off', |
| 61 | + 'no-redeclare': 'off', |
| 62 | + |
| 63 | + // Semicolons - disabled to match existing codebase style |
| 64 | + semi: 'off', |
| 65 | + |
| 66 | + // Disable multiline check - TypeScript handles this |
| 67 | + 'no-unexpected-multiline': 'off', |
| 68 | + }, |
| 69 | + }, |
| 70 | + { |
| 71 | + ignores: ['dist/**', 'node_modules/**'], |
| 72 | + }, |
| 73 | +]; |
0 commit comments