|
| 1 | +// @ts-check |
| 2 | + |
| 3 | +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ |
| 4 | +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ |
| 5 | +/* eslint-disable @typescript-eslint/no-unsafe-argument */ |
| 6 | + |
| 7 | +import eslint from '@eslint/js' |
| 8 | +import noOnlyTests from 'eslint-plugin-no-only-tests' |
| 9 | +import noSecrets from 'eslint-plugin-no-secrets' |
| 10 | +import stylistic from '@stylistic/eslint-plugin' |
| 11 | +import tseslint from 'typescript-eslint' |
| 12 | + |
| 13 | +export default tseslint.config( |
| 14 | + // Base eslint configuration |
| 15 | + // @ts-expect-error tseslint doesn't recognize eslint types for some reason |
| 16 | + eslint.configs.recommended, |
| 17 | + |
| 18 | + // Enable linting with type information |
| 19 | + // https://typescript-eslint.io/getting-started/typed-linting |
| 20 | + ...tseslint.configs.recommendedTypeChecked, |
| 21 | + { |
| 22 | + languageOptions: { |
| 23 | + parserOptions: { |
| 24 | + project: true, |
| 25 | + tsconfigRootDir: import.meta.dirname, |
| 26 | + }, |
| 27 | + }, |
| 28 | + }, |
| 29 | + |
| 30 | + // Formatting and stylistic rules |
| 31 | + stylistic.configs['recommended-flat'], |
| 32 | + |
| 33 | + // Custom rules |
| 34 | + { |
| 35 | + plugins: { |
| 36 | + 'no-only-tests': noOnlyTests, |
| 37 | + 'no-secrets': noSecrets, |
| 38 | + }, |
| 39 | + rules: { |
| 40 | + 'prefer-const': 'warn', |
| 41 | + '@typescript-eslint/no-inferrable-types': 'warn', |
| 42 | + '@typescript-eslint/no-empty-function': 'warn', |
| 43 | + 'no-only-tests/no-only-tests': 'error', |
| 44 | + 'no-secrets/no-secrets': 'error', |
| 45 | + 'sort-imports': [ |
| 46 | + 'warn', { |
| 47 | + memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'], |
| 48 | + ignoreCase: true, |
| 49 | + allowSeparatedGroups: true, |
| 50 | + }], |
| 51 | + }, |
| 52 | + }, |
| 53 | +) |
0 commit comments