|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + overrides: [ |
| 4 | + { |
| 5 | + files: ['*.ts'], |
| 6 | + parser: '@typescript-eslint/parser', |
| 7 | + parserOptions: { |
| 8 | + project: ['tsconfig.eslint.json'], |
| 9 | + createDefaultProgram: true, |
| 10 | + }, |
| 11 | + plugins: ['prettier', 'simple-import-sort'], |
| 12 | + extends: [ |
| 13 | + 'plugin:import/recommended', |
| 14 | + 'plugin:import/typescript', |
| 15 | + 'airbnb-typescript/base', |
| 16 | + 'prettier', |
| 17 | + 'plugin:prettier/recommended', |
| 18 | + ], |
| 19 | + rules: { |
| 20 | + 'prettier/prettier': 'error', |
| 21 | + 'simple-import-sort/imports': [ |
| 22 | + 'error', |
| 23 | + { |
| 24 | + groups: [ |
| 25 | + // Side effect imports. |
| 26 | + ['^\\u0000'], |
| 27 | + // Parent imports. Put `..` last. |
| 28 | + ['^\\.\\.(?!/?$)', '^\\.\\./?$'], |
| 29 | + // Other relative imports. Put same-folder imports and `.` last. |
| 30 | + ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'], |
| 31 | + // Style imports. |
| 32 | + ['^.+\\.s?css$'], |
| 33 | + ], |
| 34 | + }, |
| 35 | + ], |
| 36 | + 'simple-import-sort/exports': 'error', |
| 37 | + 'import/first': 'error', |
| 38 | + 'import/newline-after-import': 'error', |
| 39 | + 'import/no-duplicates': 'error', |
| 40 | + 'max-len': [ |
| 41 | + 'error', |
| 42 | + { |
| 43 | + code: 100, |
| 44 | + ignorePattern: '^import .*', |
| 45 | + ignoreComments: true, |
| 46 | + ignoreUrls: true, |
| 47 | + ignoreStrings: true, |
| 48 | + ignoreTemplateLiterals: true, |
| 49 | + ignoreRegExpLiterals: true, |
| 50 | + }, |
| 51 | + ], |
| 52 | + '@typescript-eslint/lines-between-class-members': [ |
| 53 | + 'error', |
| 54 | + 'always', |
| 55 | + { exceptAfterSingleLine: true }, |
| 56 | + ], |
| 57 | + '@typescript-eslint/naming-convention': [ |
| 58 | + 'error', |
| 59 | + { |
| 60 | + selector: 'interface', |
| 61 | + format: ['PascalCase'], |
| 62 | + custom: { |
| 63 | + regex: '^I[A-Z]', |
| 64 | + match: true, |
| 65 | + }, |
| 66 | + }, |
| 67 | + { |
| 68 | + selector: 'typeAlias', |
| 69 | + format: ['PascalCase'], |
| 70 | + custom: { |
| 71 | + regex: '^T[A-Z]', |
| 72 | + match: true, |
| 73 | + }, |
| 74 | + }, |
| 75 | + { |
| 76 | + selector: 'enum', |
| 77 | + format: ['PascalCase'], |
| 78 | + custom: { |
| 79 | + regex: '^E[A-Z]', |
| 80 | + match: true, |
| 81 | + }, |
| 82 | + }, |
| 83 | + ], |
| 84 | + }, |
| 85 | + reportUnusedDisableDirectives: true, |
| 86 | + }, |
| 87 | + { |
| 88 | + files: ['*.interface.ts', '*.enum.ts', '*.model.ts'], |
| 89 | + parser: '@typescript-eslint/parser', |
| 90 | + parserOptions: { |
| 91 | + extraFileExtensions: ['*.ts'], |
| 92 | + project: ['tsconfig.eslint.json'], |
| 93 | + createDefaultProgram: true, |
| 94 | + }, |
| 95 | + plugins: ['prettier'], |
| 96 | + extends: ['plugin:typescript-sort-keys/recommended'], |
| 97 | + }, |
| 98 | + { |
| 99 | + files: ['src/**/*.spec.ts', 'src/**/*.d.ts', 'src/**/*.mock.ts'], |
| 100 | + parserOptions: { |
| 101 | + project: ['tsconfig.eslint.json'], |
| 102 | + createDefaultProgram: true, |
| 103 | + }, |
| 104 | + plugins: ['prettier', 'jasmine'], |
| 105 | + extends: ['plugin:jasmine/recommended'], |
| 106 | + env: { jasmine: true }, |
| 107 | + rules: { |
| 108 | + '@typescript-eslint/no-unused-vars': 'off', |
| 109 | + 'jasmine/no-disabled-tests': 'off', |
| 110 | + }, |
| 111 | + }, |
| 112 | + ], |
| 113 | +}; |
0 commit comments