-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
171 lines (165 loc) · 4.81 KB
/
.eslintrc.json
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "es2021",
"sourceType": "module",
"project": [
"./common/tsconfig.json",
"./server/tsconfig.json",
"./client/tsconfig.json",
"./e2e/tsconfig.json",
"./markdown_parser/tsconfig.json"
]
},
"plugins": [
"@typescript-eslint",
"import",
"sonarjs",
"prettier",
"promise",
"eslint-plugin-unicorn"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/recommended",
"plugin:sonarjs/recommended",
"plugin:promise/recommended",
"plugin:unicorn/recommended",
"plugin:prettier/recommended"
],
"rules": {
"no-param-reassign": ["error"],
"prefer-template": ["error"],
"no-restricted-syntax": [
"error",
"ForInStatement",
"LabeledStatement",
"WithStatement"
],
"default-case": ["error"],
"no-underscore-dangle": ["error"],
"consistent-return": ["error"],
"operator-assignment": ["error"],
"no-return-await": ["off"],
"no-shadow": ["off"],
"no-promise-executor-return": ["error"],
"object-shorthand": ["error"],
"no-path-concat": ["error"],
"no-else-return": [
"error",
{
"allowElseIf": false
}
],
"no-useless-constructor": ["off"],
"prefer-destructuring": [
"error",
{
"object": true,
"array": false
}
],
"eqeqeq": ["error"],
"no-redeclare": ["error"],
"no-lonely-if": ["error"],
"no-cond-assign": ["error"],
"prefer-regex-literals": ["error"],
"spaced-comment": ["error"],
"no-implicit-coercion": ["error"],
"prefer-promise-reject-errors": ["error"],
"no-return-assign": ["error", "always"],
"no-continue": ["error"],
"no-void": ["error"],
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": ["camelCase", "PascalCase", "UPPER_CASE"]
},
{
"selector": "function",
"format": ["camelCase", "PascalCase"]
},
{
"selector": "typeLike",
"format": ["PascalCase"]
}
],
"arrow-body-style": [
"error",
"as-needed",
{
"requireReturnForObjectLiteral": false
}
],
"import/newline-after-import": ["error"],
"@typescript-eslint/no-unused-expressions": ["error"],
"no-useless-return": ["error"],
"prefer-arrow-callback": ["error"],
"@typescript-eslint/quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"func-names": ["error"],
"@typescript-eslint/no-shadow": ["error"],
"@typescript-eslint/explicit-function-return-type": ["error"],
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_" }
],
"@typescript-eslint/return-await": ["error"],
"@typescript-eslint/no-useless-constructor": ["error"],
"@typescript-eslint/consistent-type-assertions": [
"error",
{ "assertionStyle": "as", "objectLiteralTypeAssertions": "never" }
],
"@typescript-eslint/no-unnecessary-condition": ["error"],
"@typescript-eslint/no-unsafe-return": ["error"],
"@typescript-eslint/no-floating-promises": [
"error",
{ "ignoreVoid": false }
],
"@typescript-eslint/no-misused-promises": [
"error",
{ "checksVoidReturn": false }
],
"@typescript-eslint/no-explicit-any": ["error"],
"@typescript-eslint/no-unsafe-assignment": ["error"],
"@typescript-eslint/no-unsafe-argument": ["error"],
"@typescript-eslint/no-unsafe-member-access": ["error"],
"@typescript-eslint/no-unsafe-call": ["error"],
"@typescript-eslint/restrict-template-expressions": ["error"],
"@typescript-eslint/prefer-optional-chain": ["error"],
"promise/catch-or-return": ["error", { "allowThen": true }],
"unicorn/consistent-function-scoping": [
"error",
{ "checkArrowFunctions": false }
],
"unicorn/catch-error-name": [
"error",
{
"name": "e"
}
],
"unicorn/prefer-event-target": ["off"], // Have false positives: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1853
"unicorn/no-array-reduce": ["off"],
"unicorn/consistent-destructuring": ["off"],
"unicorn/no-null": ["off"],
"unicorn/better-regex": ["off"],
"unicorn/prefer-top-level-await": ["off"],
"unicorn/prevent-abbreviations": ["off"],
"unicorn/filename-case": ["off"],
"unicorn/no-array-for-each": ["off"],
"unicorn/no-useless-undefined": ["off"],
"unicorn/prefer-module": ["off"],
"sonarjs/cognitive-complexity": ["off"],
"sonarjs/no-inverted-boolean-check": ["error"]
},
"ignorePatterns": ["**/*.d.ts"]
}