|
1 | 1 | import * as path from 'node:path'; |
2 | 2 | import { includeIgnoreFile } from '@eslint/compat'; |
3 | 3 | import eslint from '@eslint/js'; |
4 | | -import prettierConfigPlugin from 'eslint-config-prettier'; |
5 | 4 | import importPlugin from 'eslint-plugin-import'; |
6 | 5 | import * as jsoncPlugin from 'eslint-plugin-jsonc'; |
7 | 6 | import onlyWarn from 'eslint-plugin-only-warn'; |
@@ -48,20 +47,35 @@ export default tseslint.config( |
48 | 47 | ...tseslint.configs.recommended, |
49 | 48 | ...tseslint.configs.recommendedTypeChecked, |
50 | 49 | ...tseslint.configs.stylisticTypeChecked, |
51 | | - prettierConfigPlugin, |
52 | 50 | ], |
53 | 51 | rules: { |
54 | 52 | 'prettier/prettier': ['error', prettierConfig], |
55 | | - '@typescript-eslint/array-type': 'off', |
56 | | - '@typescript-eslint/consistent-type-definitions': 'off', |
| 53 | + '@typescript-eslint/no-unused-vars': [ |
| 54 | + 'error', |
| 55 | + { |
| 56 | + args: 'all', |
| 57 | + argsIgnorePattern: '^_', |
| 58 | + varsIgnorePattern: '^_', |
| 59 | + }, |
| 60 | + ], |
57 | 61 | '@typescript-eslint/consistent-type-imports': [ |
58 | 62 | 'warn', |
59 | | - { prefer: 'type-imports', fixStyle: 'separate-type-imports' }, |
| 63 | + { prefer: 'type-imports', fixStyle: 'inline-type-imports' }, |
| 64 | + ], |
| 65 | + '@typescript-eslint/no-misused-promises': [ |
| 66 | + 2, |
| 67 | + { checksVoidReturn: { attributes: false } }, |
| 68 | + ], |
| 69 | + '@typescript-eslint/no-unnecessary-condition': [ |
| 70 | + 'error', |
| 71 | + { |
| 72 | + allowConstantLoopConditions: true, |
| 73 | + }, |
60 | 74 | ], |
61 | | - '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], |
62 | | - '@typescript-eslint/require-await': 'off', |
63 | | - '@typescript-eslint/no-misused-promises': 'warn', |
64 | | - 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], |
| 75 | + '@typescript-eslint/no-non-null-assertion': 'error', |
| 76 | + // Disable this rule because it conflicts with @typescript-eslint/consistent-type-imports |
| 77 | + // when using prettier's import sorter |
| 78 | + 'import/consistent-type-specifier-style': 'off', |
65 | 79 | }, |
66 | 80 | }, |
67 | 81 | { |
|
0 commit comments