|
| 1 | +import tseslint from '@typescript-eslint/eslint-plugin'; |
| 2 | +import tsparser from '@typescript-eslint/parser'; |
| 3 | +import importPlugin from 'eslint-plugin-import'; |
| 4 | + |
| 5 | +export default [ |
| 6 | + { |
| 7 | + ignores: [ |
| 8 | + 'build/**', |
| 9 | + 'node_modules/**', |
| 10 | + 'coverage/**', |
| 11 | + '**/*.js', |
| 12 | + '**/*.d.ts', |
| 13 | + 'dist/**', |
| 14 | + 'tests/**', |
| 15 | + '*.config.ts', |
| 16 | + '*.config.js' |
| 17 | + ] |
| 18 | + }, |
| 19 | + { |
| 20 | + files: ['src/**/*.ts'], |
| 21 | + languageOptions: { |
| 22 | + parser: tsparser, |
| 23 | + parserOptions: { |
| 24 | + ecmaVersion: 2022, |
| 25 | + sourceType: 'module', |
| 26 | + project: './tsconfig.json' |
| 27 | + }, |
| 28 | + globals: { |
| 29 | + console: 'readonly', |
| 30 | + process: 'readonly', |
| 31 | + Buffer: 'readonly', |
| 32 | + __dirname: 'readonly', |
| 33 | + __filename: 'readonly', |
| 34 | + module: 'readonly', |
| 35 | + require: 'readonly' |
| 36 | + } |
| 37 | + }, |
| 38 | + plugins: { |
| 39 | + '@typescript-eslint': tseslint, |
| 40 | + 'import': importPlugin |
| 41 | + }, |
| 42 | + rules: { |
| 43 | + // TypeScript specific rules |
| 44 | + '@typescript-eslint/no-unused-vars': ['error', { |
| 45 | + argsIgnorePattern: '^_', |
| 46 | + varsIgnorePattern: '^_', |
| 47 | + destructuredArrayIgnorePattern: '^_' |
| 48 | + }], |
| 49 | + '@typescript-eslint/no-explicit-any': 'off', // Turned off for now - can be enabled gradually |
| 50 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 51 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 52 | + '@typescript-eslint/no-floating-promises': 'error', |
| 53 | + '@typescript-eslint/no-misused-promises': 'error', |
| 54 | + '@typescript-eslint/await-thenable': 'warn', // Downgraded to warning |
| 55 | + |
| 56 | + // General rules |
| 57 | + 'no-console': ['warn', { allow: ['warn', 'error'] }], |
| 58 | + 'prefer-const': 'error', |
| 59 | + 'no-var': 'error', |
| 60 | + 'eqeqeq': ['error', 'always'], |
| 61 | + 'curly': ['error', 'all'], |
| 62 | + 'brace-style': ['error', '1tbs'], |
| 63 | + |
| 64 | + // Import rules - relaxed |
| 65 | + 'import/order': 'off', // Too strict for now |
| 66 | + 'import/newline-after-import': 'off', |
| 67 | + 'import/no-duplicates': 'error' |
| 68 | + } |
| 69 | + } |
| 70 | +]; |
0 commit comments