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