|
| 1 | +import eslint from '@eslint/js'; |
| 2 | +import tseslint from 'typescript-eslint'; |
| 3 | +import eslintConfigPrettier from 'eslint-config-prettier/flat'; |
| 4 | +import eslintPluginUnicorn from 'eslint-plugin-unicorn'; |
| 5 | +import nodePlugin from 'eslint-plugin-n'; |
| 6 | +import pluginPromise from 'eslint-plugin-promise'; |
| 7 | +import pluginAva from 'eslint-plugin-ava'; |
| 8 | +import unusedImports from 'eslint-plugin-unused-imports'; |
| 9 | +import importPlugin from 'eslint-plugin-import-x'; |
| 10 | +import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'; |
| 11 | + |
| 12 | +export default tseslint.config( |
| 13 | + { |
| 14 | + ignores: ['dist/**', 'node_modules/**'], |
| 15 | + }, |
| 16 | + |
| 17 | + eslint.configs.recommended, |
| 18 | + ...tseslint.configs.recommended, |
| 19 | + { |
| 20 | + languageOptions: { |
| 21 | + parserOptions: { |
| 22 | + projectService: true, |
| 23 | + tsconfigRootDir: import.meta.dirname, |
| 24 | + }, |
| 25 | + }, |
| 26 | + }, |
| 27 | + importPlugin.flatConfigs.recommended, |
| 28 | + importPlugin.flatConfigs.typescript, |
| 29 | + eslintPluginUnicorn.configs.recommended, |
| 30 | + nodePlugin.configs['flat/recommended-module'], |
| 31 | + pluginPromise.configs['flat/recommended'], |
| 32 | + ...pluginAva.configs['recommended'], |
| 33 | + eslintConfigPrettier, |
| 34 | + |
| 35 | + { |
| 36 | + files: ['src/**/*.ts'], |
| 37 | + plugins: { |
| 38 | + 'unused-imports': unusedImports, |
| 39 | + }, |
| 40 | + settings: { |
| 41 | + 'import-x/resolver-next': [ |
| 42 | + createTypeScriptImportResolver({ |
| 43 | + project: './tsconfig.json', |
| 44 | + }), |
| 45 | + ], |
| 46 | + }, |
| 47 | + rules: { |
| 48 | + 'unicorn/no-null': 'off', |
| 49 | + 'unicorn/prevent-abbreviations': 'off', |
| 50 | + 'unicorn/consistent-function-scoping': 'off', |
| 51 | + 'n/no-missing-import': 'off', |
| 52 | + 'n/no-unsupported-features/node-builtins': 'off', |
| 53 | + 'import-x/no-named-as-default': 'off', |
| 54 | + 'unused-imports/no-unused-imports': 'error', |
| 55 | + 'no-console': 'error', |
| 56 | + 'require-await': 'off', |
| 57 | + '@typescript-eslint/require-await': 'error', |
| 58 | + '@typescript-eslint/naming-convention': 'error', |
| 59 | + 'import-x/no-cycle': 'error', |
| 60 | + 'import-x/no-self-import': 'error', |
| 61 | + '@typescript-eslint/consistent-type-imports': 'error', |
| 62 | + 'import-x/order': [ |
| 63 | + 'error', |
| 64 | + { |
| 65 | + 'newlines-between': 'always', |
| 66 | + alphabetize: { order: 'asc', caseInsensitive: true }, |
| 67 | + }, |
| 68 | + ], |
| 69 | + }, |
| 70 | + }, |
| 71 | + |
| 72 | + { |
| 73 | + files: ['src/grpc/**/*.ts'], |
| 74 | + rules: { |
| 75 | + '@typescript-eslint/naming-convention': 'off', |
| 76 | + '@typescript-eslint/no-require-imports': 'off', |
| 77 | + }, |
| 78 | + }, |
| 79 | + |
| 80 | + { |
| 81 | + files: ['**/*test.ts'], |
| 82 | + rules: { |
| 83 | + 'unicorn/no-array-for-each': 'off', |
| 84 | + 'ava/no-conditional-assertion': 'off', |
| 85 | + }, |
| 86 | + }, |
| 87 | + |
| 88 | + { |
| 89 | + files: ['src/errors/errors.ts'], |
| 90 | + rules: { |
| 91 | + '@typescript-eslint/naming-convention': 'off', |
| 92 | + }, |
| 93 | + }, |
| 94 | +); |
0 commit comments