|
| 1 | +import github from 'eslint-plugin-github' |
| 2 | +import jest from 'eslint-plugin-jest' |
| 3 | +import tseslint from 'typescript-eslint' |
| 4 | + |
| 5 | +const githubConfigs = github.getFlatConfigs() |
| 6 | + |
| 7 | +export default tseslint.config( |
| 8 | + { |
| 9 | + ignores: ['dist/', 'lib/', 'node_modules/', 'jest.config.js'] |
| 10 | + }, |
| 11 | + githubConfigs.recommended, |
| 12 | + ...tseslint.configs.recommended, |
| 13 | + { |
| 14 | + files: ['**/*.ts'], |
| 15 | + plugins: { |
| 16 | + jest |
| 17 | + }, |
| 18 | + languageOptions: { |
| 19 | + parserOptions: { |
| 20 | + ecmaVersion: 9, |
| 21 | + sourceType: 'module', |
| 22 | + project: './tsconfig.json' |
| 23 | + } |
| 24 | + }, |
| 25 | + rules: { |
| 26 | + 'filenamesPlugin/match-regex': 'off', |
| 27 | + 'i18n-text/no-en': 'off', |
| 28 | + 'eslint-comments/no-use': 'off', |
| 29 | + 'import/no-namespace': 'off', |
| 30 | + 'importPlugin/no-namespace': 'off', |
| 31 | + 'importPlugin/no-unresolved': 'off', |
| 32 | + 'no-unused-vars': 'off', |
| 33 | + '@typescript-eslint/no-unused-vars': 'error', |
| 34 | + '@typescript-eslint/explicit-member-accessibility': [ |
| 35 | + 'error', |
| 36 | + {accessibility: 'no-public'} |
| 37 | + ], |
| 38 | + '@typescript-eslint/no-require-imports': 'error', |
| 39 | + '@typescript-eslint/array-type': 'error', |
| 40 | + '@typescript-eslint/await-thenable': 'error', |
| 41 | + '@typescript-eslint/ban-ts-comment': 'error', |
| 42 | + camelcase: 'off', |
| 43 | + '@typescript-eslint/consistent-type-assertions': 'error', |
| 44 | + '@typescript-eslint/explicit-function-return-type': [ |
| 45 | + 'error', |
| 46 | + {allowExpressions: true} |
| 47 | + ], |
| 48 | + '@typescript-eslint/no-array-constructor': 'error', |
| 49 | + '@typescript-eslint/no-explicit-any': 'error', |
| 50 | + '@typescript-eslint/no-extraneous-class': 'error', |
| 51 | + '@typescript-eslint/no-for-in-array': 'error', |
| 52 | + '@typescript-eslint/no-inferrable-types': 'error', |
| 53 | + '@typescript-eslint/no-misused-new': 'error', |
| 54 | + '@typescript-eslint/no-namespace': 'error', |
| 55 | + '@typescript-eslint/no-non-null-assertion': 'warn', |
| 56 | + '@typescript-eslint/no-unnecessary-qualifier': 'error', |
| 57 | + '@typescript-eslint/no-unnecessary-type-assertion': 'error', |
| 58 | + '@typescript-eslint/no-useless-constructor': 'error', |
| 59 | + '@typescript-eslint/prefer-for-of': 'warn', |
| 60 | + '@typescript-eslint/prefer-function-type': 'warn', |
| 61 | + '@typescript-eslint/prefer-includes': 'error', |
| 62 | + '@typescript-eslint/prefer-string-starts-ends-with': 'error', |
| 63 | + '@typescript-eslint/promise-function-async': 'error', |
| 64 | + '@typescript-eslint/require-array-sort-compare': 'error', |
| 65 | + '@typescript-eslint/restrict-plus-operands': 'error', |
| 66 | + semi: 'off', |
| 67 | + '@typescript-eslint/unbound-method': 'error' |
| 68 | + } |
| 69 | + } |
| 70 | +) |
0 commit comments