|
| 1 | +import js from '@eslint/js' |
| 2 | +import globals from 'globals' |
| 3 | +import tseslint from 'typescript-eslint' |
| 4 | +import prettier from 'eslint-config-prettier' |
| 5 | + |
| 6 | +export default tseslint.config( |
| 7 | + { |
| 8 | + ignores: ['dist', 'coverage', 'node_modules', '**/*.config.ts', '**/*.config.js'], |
| 9 | + }, |
| 10 | + js.configs.recommended, |
| 11 | + ...tseslint.configs.recommended, |
| 12 | + ...tseslint.configs.recommendedTypeChecked, |
| 13 | + prettier, |
| 14 | + { |
| 15 | + languageOptions: { |
| 16 | + parserOptions: { |
| 17 | + project: './tsconfig.json', |
| 18 | + ecmaVersion: 2022, |
| 19 | + sourceType: 'module', |
| 20 | + }, |
| 21 | + globals: { |
| 22 | + ...globals.browser, |
| 23 | + ...globals.node, |
| 24 | + }, |
| 25 | + }, |
| 26 | + rules: { |
| 27 | + '@typescript-eslint/no-unused-vars': [ |
| 28 | + 'error', |
| 29 | + { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, |
| 30 | + ], |
| 31 | + '@typescript-eslint/consistent-type-imports': 'error', |
| 32 | + '@typescript-eslint/no-floating-promises': 'error', |
| 33 | + '@typescript-eslint/no-misused-promises': 'error', |
| 34 | + '@typescript-eslint/no-explicit-any': 'error', |
| 35 | + '@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }], |
| 36 | + 'no-console': ['warn', { allow: ['warn', 'error'] }], |
| 37 | + eqeqeq: ['error', 'always'], |
| 38 | + 'prefer-const': 'error', |
| 39 | + 'no-var': 'error', |
| 40 | + }, |
| 41 | + }, |
| 42 | +) |
0 commit comments