|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + env: { |
| 4 | + node: true, |
| 5 | + es2021: true, |
| 6 | + }, |
| 7 | + parser: '@typescript-eslint/parser', |
| 8 | + parserOptions: { |
| 9 | + project: './tsconfig.json', |
| 10 | + ecmaVersion: 'latest', |
| 11 | + sourceType: 'module', |
| 12 | + }, |
| 13 | + settings: { |
| 14 | + 'import/parsers': { |
| 15 | + '@typescript-eslint/parser': ['.ts'], |
| 16 | + }, |
| 17 | + 'import/resolver': { |
| 18 | + node: { |
| 19 | + project: './tsconfig.json', |
| 20 | + paths: ['@modules', '@common', '@config', '@migrations'], |
| 21 | + extensions: ['.js', '.ts'], |
| 22 | + }, |
| 23 | + typescript: { |
| 24 | + project: './tsconfig.json', |
| 25 | + alwaysTryTypes: true, |
| 26 | + }, |
| 27 | + alias: { |
| 28 | + map: [ |
| 29 | + ['@modules', './src/modules'], |
| 30 | + ['@common', './src/common'], |
| 31 | + ['@config', './src/config'], |
| 32 | + ['@migrations', './src/migrations'], |
| 33 | + ], |
| 34 | + extensions: ['.ts', '.js'], |
| 35 | + }, |
| 36 | + }, |
| 37 | + 'import/ignore': ['node_modules'], |
| 38 | + }, |
| 39 | + plugins: [ |
| 40 | + '@typescript-eslint', |
| 41 | + '@trilon/eslint-plugin', |
| 42 | + 'import', |
| 43 | + 'nestjs', |
| 44 | + 'eslint-plugin-import-helpers', |
| 45 | + 'prettier', |
| 46 | + ], |
| 47 | + extends: [ |
| 48 | + 'plugin:@typescript-eslint/strict-type-checked', |
| 49 | + 'plugin:@typescript-eslint/stylistic-type-checked', |
| 50 | + 'plugin:@trilon/recommended', |
| 51 | + 'plugin:sonarjs/recommended', |
| 52 | + 'plugin:import/recommended', |
| 53 | + 'plugin:import/typescript', |
| 54 | + 'plugin:unicorn/recommended', |
| 55 | + 'plugin:nestjs/recommended', |
| 56 | + 'plugin:eslint-comments/recommended', |
| 57 | + 'prettier', |
| 58 | + ], |
| 59 | + overrides: [ |
| 60 | + { |
| 61 | + files: ['*.spec.ts', '*.mock.ts'], |
| 62 | + extends: ['plugin:vitest/recommended'], |
| 63 | + rules: { |
| 64 | + 'sonarjs/no-duplicate-string': 'off', |
| 65 | + }, |
| 66 | + }, |
| 67 | + ], |
| 68 | + ignorePatterns: [ |
| 69 | + '**/node_modules/**', |
| 70 | + '**/dist/**', |
| 71 | + 'README.md', |
| 72 | + '.eslintrc.cjs', |
| 73 | + ], |
| 74 | + rules: { |
| 75 | + 'prettier/prettier': 'warn', |
| 76 | + 'prefer-const': 'warn', |
| 77 | + '@typescript-eslint/no-unused-vars': [ |
| 78 | + 'error', |
| 79 | + { ignoreRestSiblings: true, argsIgnorePattern: '^_' }, |
| 80 | + ], |
| 81 | + '@typescript-eslint/interface-name-prefix': 'off', |
| 82 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 83 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 84 | + '@typescript-eslint/no-extraneous-class': 'off', |
| 85 | + '@typescript-eslint/no-empty-function': 'off', |
| 86 | + '@typescript-eslint/no-floating-promises': 'off', |
| 87 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 88 | + '@typescript-eslint/no-unsafe-argument': 'off', |
| 89 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 90 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 91 | + '@typescript-eslint/restrict-template-expressions': [ |
| 92 | + 'error', |
| 93 | + { |
| 94 | + allowNumber: true, |
| 95 | + }, |
| 96 | + ], |
| 97 | + '@typescript-eslint/no-unnecessary-type-assertion': [ |
| 98 | + 'error', |
| 99 | + { |
| 100 | + typesToIgnore: ['const'], |
| 101 | + }, |
| 102 | + ], |
| 103 | + '@trilon/detect-circular-reference': 'off', |
| 104 | + 'nestjs/use-validation-pipe': 'off', |
| 105 | + 'import/order': [ |
| 106 | + 'warn', |
| 107 | + { |
| 108 | + 'newlines-between': 'always', |
| 109 | + }, |
| 110 | + ], |
| 111 | + 'import/no-cycle': 'warn', |
| 112 | + 'unicorn/no-array-reduce': 'off', |
| 113 | + 'unicorn/no-null': 'off', |
| 114 | + 'unicorn/no-array-callback-reference': 'off', |
| 115 | + 'unicorn/prefer-top-level-await': 'off', |
| 116 | + 'unicorn/no-useless-undefined': 'off', |
| 117 | + 'unicorn/throw-new-error': 'off', |
| 118 | + 'unicorn/prevent-abbreviations': [ |
| 119 | + 'error', |
| 120 | + { |
| 121 | + replacements: { |
| 122 | + e: false, |
| 123 | + }, |
| 124 | + allowList: { |
| 125 | + param: true, |
| 126 | + params: true, |
| 127 | + ref: true, |
| 128 | + Ref: true, |
| 129 | + Param: true, |
| 130 | + Params: true, |
| 131 | + args: true, |
| 132 | + env: true, |
| 133 | + doc: true, |
| 134 | + }, |
| 135 | + }, |
| 136 | + ], |
| 137 | + }, |
| 138 | +} |
0 commit comments