24
24
"brace-style": "off",
25
25
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
26
26
"camelcase": "off",
27
- "@typescript-eslint/camelcase": ["error", {
28
- "properties": "always",
29
- "genericType": "always",
30
- "ignoreDestructuring": false
31
- }],
32
27
"@typescript-eslint/ban-types": ["error", {
33
28
"types": {
34
29
69
64
"@typescript-eslint/prefer-regexp-exec": "error",
70
65
"@typescript-eslint/prefer-optional-chain": "error",
71
66
"@typescript-eslint/no-extra-parens": "off",
72
- "@typescript-eslint/class-name-casing": "error",
73
67
"@typescript-eslint/no-extra-non-null-assertion": "error",
74
68
"@typescript-eslint/adjacent-overload-signatures": "error",
75
69
"@typescript-eslint/no-for-in-array": "error",
85
79
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
86
80
"func-call-spacing": "off",
87
81
"@typescript-eslint/func-call-spacing": ["error", "never"],
88
- "@typescript-eslint/no-namespace": ["error", {
89
-
90
- "allowDeclarations": true,
91
- "allowDefinitionFiles": true
92
- }],
82
+ "@typescript-eslint/no-namespace": "off",
93
83
"@typescript-eslint/consistent-type-assertions": ["error", {
94
84
"assertionStyle": "as"
95
85
}],
101
91
"caughtErrors": "all"
102
92
}],
103
93
"no-unused-expressions": "off",
94
+ "no-use-before-define": "off",
104
95
"@typescript-eslint/no-unused-expressions": ["error"],
105
96
"no-useless-constructor": "off",
106
97
"@typescript-eslint/no-useless-constructor": ["error"],
109
100
"@typescript-eslint/comma-spacing": ["error"],
110
101
"@typescript-eslint/unified-signatures": ["error"],
111
102
"semi": "off",
103
+ "prefer-const": "off",
112
104
"@typescript-eslint/semi": ["error"],
113
- "@typescript-eslint/no-use-before-define": ["error"] ,
105
+ "@typescript-eslint/no-use-before-define": "off" ,
114
106
"@typescript-eslint/no-unnecessary-type-assertion": ["error"],
115
107
"@typescript-eslint/no-unnecessary-type-arguments": ["error"],
116
108
"@typescript-eslint/unbound-method": ["error"],
117
109
"@typescript-eslint/type-annotation-spacing": ["error"],
118
110
"@typescript-eslint/no-unnecessary-condition": ["off"],
119
- "@typescript-eslint/no-magic-numbers": ["off", {
120
- "ignoreEnums": true
121
- }],
122
111
"@typescript-eslint/no-unnecessary-boolean-literal-compare": ["warn"],
123
112
"@typescript-eslint/member-ordering": ["off"],
124
113
"@typescript-eslint/no-this-alias": [
128
117
"allowedNames": ["_this"]
129
118
}
130
119
],
131
- "@typescript-eslint/member-naming": ["error", {
132
- "private": "^_",
133
- "protected": "^_"
134
- }],
135
120
"@typescript-eslint/no-explicit-any": ["off", {
136
121
"fixToUnknown": true,
137
122
"ignoreRestArgs": true
152
137
"requireLast": true
153
138
}
154
139
}],
155
- "@typescript-eslint/interface-name-prefix": ["warn", {
156
- "prefixWithI": "always",
157
- "allowUnderscorePrefix": false
158
- }],
140
+ "@typescript-eslint/naming-convention": [
141
+ "error",
142
+ {
143
+ "selector": "default",
144
+ "format": ["camelCase"],
145
+ "leadingUnderscore": "forbid"
146
+ },
147
+ {
148
+ "selector": "parameter",
149
+ "format": ["camelCase"]
150
+ },
151
+ {
152
+ "selector": "property",
153
+ "format": ["snake_case"],
154
+ "filter": {
155
+ // you can expand this regex to add more allowed names
156
+ "regex": "^(target_id|target_type|payer_account|date_type|date_start|date_end|page_type|max_id|min_id|sort_order|sort_by|filter_by|filter_id|http_status_code|http_status_msg|redirect_uri|expires_in|input_token|access_token|refresh_token|grant_type|token_type|client_id|client_secret)$",
157
+ "match": true
158
+ }
159
+ },
160
+ {
161
+ "selector": "property",
162
+ "format": ["snake_case", "camelCase"],
163
+ "filter": {
164
+ // you can expand this regex as you find more cases that require quoting that you want to allow
165
+ "regex": "\\?$",
166
+ "match": true
167
+ }
168
+ },
169
+ {
170
+ "selector": "memberLike",
171
+ "modifiers": ["private"],
172
+ "format": ["camelCase"],
173
+ "leadingUnderscore": "require"
174
+ },
175
+ {
176
+ "selector": "memberLike",
177
+ "modifiers": ["protected"],
178
+ "format": ["camelCase"],
179
+ "leadingUnderscore": "require"
180
+ },
181
+ {
182
+ "selector": "memberLike",
183
+ "modifiers": ["private", "static"],
184
+ "format": [],
185
+ "custom": {
186
+ "regex": "^_\\$[^_]",
187
+ "match": true
188
+ }
189
+ },
190
+ {
191
+ "selector": "memberLike",
192
+ "modifiers": ["protected", "static"],
193
+ "format": [],
194
+ "custom": {
195
+ "regex": "^_\\$[^_]",
196
+ "match": true
197
+ }
198
+ },
199
+ {
200
+ "selector": "enumMember",
201
+ "format": ["UPPER_CASE"]
202
+ },
203
+ {
204
+ "selector": "variable",
205
+ "format": ["camelCase", "UPPER_CASE"]
206
+ },
207
+ {
208
+ "selector": "typeParameter",
209
+ "format": ["PascalCase"],
210
+ "prefix": ["T"]
211
+ },
212
+ {
213
+ "selector": "interface",
214
+ "format": ["PascalCase"],
215
+ "custom": {
216
+ "regex": "^I[A-Z]",
217
+ "match": true
218
+ }
219
+ },
220
+ {
221
+ "selector": "class",
222
+ "format": ["PascalCase"]
223
+ },
224
+ {
225
+ "selector": "enum",
226
+ "format": ["PascalCase"],
227
+ "custom": {
228
+ "regex": "^E[A-Z]",
229
+ "match": true
230
+ }
231
+ },
232
+ {
233
+ "selector": "typeAlias",
234
+ "format": ["PascalCase"]
235
+ }
236
+ ],
159
237
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
160
238
"no-multiple-empty-lines": ["error", {"max": 1, "maxEOF": 0, "maxBOF": 0}],
161
239
"no-trailing-spaces": "error",
162
240
"block-spacing":"error",
163
- "space-before-blocks": "error",
164
241
"eol-last":"error",
242
+ "space-before-blocks": "error",
165
243
"indent": "off",
166
244
"@typescript-eslint/indent": ["error", 4, {
167
245
"SwitchCase": 1,
181
259
"quotes": [
182
260
"error",
183
261
"single"
184
- ],
185
- "no-fallthrough": "off"
262
+ ]
186
263
}
187
264
}
0 commit comments