* @returns {import('typescript-eslint').ConfigWithExtends}
()
| 9 | * @returns {import('typescript-eslint').ConfigWithExtends} |
| 10 | */ |
| 11 | function buildBaseConfig() { |
| 12 | return { |
| 13 | extends: [ |
| 14 | eslint.configs.recommended, |
| 15 | ...tseslint.configs.strictTypeChecked, |
| 16 | ], |
| 17 | languageOptions: { |
| 18 | parser: tseslint.parser, |
| 19 | parserOptions: { |
| 20 | project: './tsconfig.json', |
| 21 | }, |
| 22 | }, |
| 23 | plugins: { |
| 24 | '@typescript-eslint': tseslint.plugin, |
| 25 | 'simple-import-sort': simpleImportSort, |
| 26 | }, |
| 27 | rules: { |
| 28 | '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], |
| 29 | '@typescript-eslint/explicit-member-accessibility': [ |
| 30 | 'error', |
| 31 | { |
| 32 | overrides: { |
| 33 | constructors: 'no-public', |
| 34 | }, |
| 35 | }, |
| 36 | ], |
| 37 | '@typescript-eslint/member-ordering': ['warn'], |
| 38 | '@typescript-eslint/naming-convention': [ |
| 39 | 'error', |
| 40 | { |
| 41 | selector: ['classProperty'], |
| 42 | format: ['strictCamelCase', 'UPPER_CASE', 'snake_case'], |
| 43 | leadingUnderscore: 'allow', |
| 44 | }, |
| 45 | { |
| 46 | selector: 'typeParameter', |
| 47 | format: ['StrictPascalCase'], |
| 48 | prefix: ['T'], |
| 49 | }, |
| 50 | { |
| 51 | selector: ['typeLike'], |
| 52 | format: ['StrictPascalCase'], |
| 53 | }, |
| 54 | { |
| 55 | selector: ['function', 'classMethod'], |
| 56 | format: ['strictCamelCase'], |
| 57 | leadingUnderscore: 'allow', |
| 58 | }, |
| 59 | { |
| 60 | selector: ['parameter'], |
| 61 | format: ['strictCamelCase'], |
| 62 | leadingUnderscore: 'allow', |
| 63 | }, |
| 64 | { |
| 65 | selector: ['variableLike'], |
| 66 | format: ['strictCamelCase', 'UPPER_CASE', 'snake_case'], |
| 67 | }, |
| 68 | ], |