|
| 1 | +import js from '@eslint/js' |
| 2 | +import prettierConfig from 'eslint-config-prettier' |
| 3 | +import { config, configs, parser } from 'typescript-eslint' |
| 4 | + |
| 5 | +const ESLintConfig = config( |
| 6 | + { name: 'ignores', ignores: ['**/dist/', '**/__testfixtures__/'] }, |
| 7 | + { name: 'javascript', ...js.configs.recommended }, |
| 8 | + ...configs.recommended, |
| 9 | + ...configs.stylistic, |
| 10 | + { name: 'prettier-config', ...prettierConfig }, |
| 11 | + { |
| 12 | + name: 'main', |
| 13 | + languageOptions: { |
| 14 | + parser, |
| 15 | + parserOptions: { |
| 16 | + projectService: { |
| 17 | + defaultProject: './tsconfig.json', |
| 18 | + }, |
| 19 | + ecmaVersion: 'latest', |
| 20 | + }, |
| 21 | + }, |
| 22 | + rules: { |
| 23 | + 'no-undef': [0], |
| 24 | + '@typescript-eslint/consistent-type-imports': [ |
| 25 | + 2, |
| 26 | + { fixStyle: 'separate-type-imports', disallowTypeAnnotations: false }, |
| 27 | + ], |
| 28 | + '@typescript-eslint/consistent-type-exports': [2], |
| 29 | + '@typescript-eslint/no-unused-vars': [0], |
| 30 | + '@typescript-eslint/no-explicit-any': [0], |
| 31 | + '@typescript-eslint/no-empty-object-type': [ |
| 32 | + 2, |
| 33 | + { allowInterfaces: 'with-single-extends' }, |
| 34 | + ], |
| 35 | + '@typescript-eslint/no-namespace': [ |
| 36 | + 2, |
| 37 | + { allowDeclarations: true, allowDefinitionFiles: true }, |
| 38 | + ], |
| 39 | + '@typescript-eslint/ban-ts-comment': [0], |
| 40 | + 'sort-imports': [ |
| 41 | + 2, |
| 42 | + { |
| 43 | + ignoreCase: false, |
| 44 | + ignoreDeclarationSort: true, |
| 45 | + ignoreMemberSort: false, |
| 46 | + memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], |
| 47 | + allowSeparatedGroups: true, |
| 48 | + }, |
| 49 | + ], |
| 50 | + }, |
| 51 | + linterOptions: { reportUnusedDisableDirectives: 2 }, |
| 52 | + }, |
| 53 | + { |
| 54 | + name: 'commonjs', |
| 55 | + files: ['**/*.c[jt]s'], |
| 56 | + languageOptions: { sourceType: 'commonjs' }, |
| 57 | + rules: { |
| 58 | + '@typescript-eslint/no-require-imports': [0], |
| 59 | + }, |
| 60 | + }, |
| 61 | +) |
| 62 | + |
| 63 | +export default ESLintConfig |
0 commit comments