|
| 1 | +// @ts-check |
| 2 | +const eslint = require('@eslint/js'); |
| 3 | +const tseslint = require('typescript-eslint'); |
| 4 | +const prettier = require('eslint-plugin-prettier'); |
| 5 | +const prettierConfig = require('eslint-config-prettier'); |
| 6 | + |
| 7 | +module.exports = tseslint.config( |
| 8 | + eslint.configs.recommended, |
| 9 | + ...tseslint.configs.recommendedTypeChecked, |
| 10 | + { |
| 11 | + languageOptions: { |
| 12 | + parser: tseslint.parser, |
| 13 | + parserOptions: { |
| 14 | + project: './tsconfig.json', |
| 15 | + ecmaVersion: 2020, |
| 16 | + sourceType: 'module', |
| 17 | + }, |
| 18 | + }, |
| 19 | + plugins: { |
| 20 | + prettier: prettier, |
| 21 | + }, |
| 22 | + rules: { |
| 23 | + ...prettierConfig.rules, |
| 24 | + '@typescript-eslint/no-explicit-any': 'off', // Many any types in codebase, will fix incrementally |
| 25 | + '@typescript-eslint/no-unsafe-assignment': 'off', // Will fix incrementally |
| 26 | + '@typescript-eslint/no-unsafe-member-access': 'off', // Will fix incrementally |
| 27 | + '@typescript-eslint/no-unsafe-call': 'off', // Will fix incrementally |
| 28 | + '@typescript-eslint/no-unsafe-return': 'off', // Will fix incrementally |
| 29 | + '@typescript-eslint/no-unsafe-argument': 'off', // Will fix incrementally |
| 30 | + '@typescript-eslint/restrict-template-expressions': 'off', // Will fix incrementally |
| 31 | + '@typescript-eslint/unbound-method': 'off', // Will fix incrementally |
| 32 | + '@typescript-eslint/require-await': 'warn', // Allow async without await |
| 33 | + '@typescript-eslint/no-misused-promises': 'warn', // Allow promises in callbacks |
| 34 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 35 | + 'no-case-declarations': 'off', // Allow declarations in case blocks |
| 36 | + '@typescript-eslint/no-unused-vars': [ |
| 37 | + 'warn', // Changed to warn for now |
| 38 | + { |
| 39 | + argsIgnorePattern: '^_', |
| 40 | + varsIgnorePattern: '^_', |
| 41 | + }, |
| 42 | + ], |
| 43 | + 'prettier/prettier': 'error', |
| 44 | + }, |
| 45 | + }, |
| 46 | + { |
| 47 | + ignores: [ |
| 48 | + 'dist/**', |
| 49 | + 'node_modules/**', |
| 50 | + '*.js', |
| 51 | + 'src/extension/**', |
| 52 | + 'examples/**', |
| 53 | + 'tests/**', |
| 54 | + ], |
| 55 | + } |
| 56 | +); |
| 57 | + |
0 commit comments