1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es6": true
5
+ },
6
+ "extends": [
7
+ "eslint:recommended",
8
+ "plugin:@typescript-eslint/eslint-recommended"
9
+ ],
10
+ "globals": {
11
+ "Atomics": "readonly",
12
+ "SharedArrayBuffer": "readonly"
13
+ },
14
+ "parser": "@typescript-eslint/parser",
15
+ "parserOptions": {
16
+ "ecmaVersion": 2020,
17
+ "sourceType": "module",
18
+ "project": "./tsconfig.json"
19
+ },
20
+ "plugins": [
21
+ "@typescript-eslint"
22
+ ],
23
+ "rules": {
24
+ "brace-style": "off",
25
+ "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
26
+ "max-len": ["error", 100],
27
+ "camelcase": "off",
28
+ "@typescript-eslint/ban-types": ["error", {
29
+ "types": {
30
+
31
+ "String": {
32
+ "message": "Use string instead",
33
+ "fixWith": "string"
34
+ },
35
+ "Number": {
36
+ "message": "Use number instead",
37
+ "fixWith": "number"
38
+ },
39
+ "Boolean": {
40
+ "message": "Use number instead",
41
+ "fixWith": "boolean"
42
+ },
43
+ "Object": {
44
+ "message": "Use {} instead",
45
+ "fixWith": "{}"
46
+ }
47
+ }
48
+ }],
49
+ "no-extra-semi": "off",
50
+ "@typescript-eslint/no-extra-semi": ["error"],
51
+ "@typescript-eslint/no-base-to-string": ["warn"],
52
+ "@typescript-eslint/await-thenable": ["error"],
53
+ "@typescript-eslint/array-type": ["error", { "default": "array-simple" }],
54
+ "@typescript-eslint/prefer-as-const": "error",
55
+ "@typescript-eslint/no-extraneous-class": "error",
56
+ "@typescript-eslint/no-floating-promises": ["error", { "ignoreVoid": false }],
57
+ "@typescript-eslint/no-array-constructor": "error",
58
+ "@typescript-eslint/no-empty-function": "error",
59
+ "@typescript-eslint/no-empty-interface": "error",
60
+ "@typescript-eslint/prefer-for-of": "error",
61
+ "@typescript-eslint/prefer-nullish-coalescing": "error",
62
+ "@typescript-eslint/prefer-function-type": "error",
63
+ "@typescript-eslint/prefer-includes": "error",
64
+ "@typescript-eslint/prefer-string-starts-ends-with": "error",
65
+ "@typescript-eslint/prefer-regexp-exec": "error",
66
+ "@typescript-eslint/prefer-optional-chain": "error",
67
+ "@typescript-eslint/no-extra-parens": "off",
68
+ "@typescript-eslint/no-extra-non-null-assertion": "error",
69
+ "@typescript-eslint/adjacent-overload-signatures": "error",
70
+ "@typescript-eslint/no-for-in-array": "error",
71
+ "@typescript-eslint/default-param-last": "error",
72
+ "@typescript-eslint/explicit-member-accessibility": "error",
73
+ "@typescript-eslint/explicit-function-return-type": ["error", {
74
+ "allowExpressions": true
75
+ }],
76
+ "@typescript-eslint/explicit-module-boundary-types": "error",
77
+ "@typescript-eslint/no-misused-new": "error",
78
+ "@typescript-eslint/no-misused-promises": "error",
79
+ "@typescript-eslint/no-require-imports": "warn",
80
+ "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
81
+ "func-call-spacing": "off",
82
+ "@typescript-eslint/func-call-spacing": ["error", "never"],
83
+ "@typescript-eslint/no-namespace": "off",
84
+ "@typescript-eslint/consistent-type-assertions": ["error", {
85
+ "assertionStyle": "as"
86
+ }],
87
+ "no-unused-vars": "off",
88
+ "@typescript-eslint/no-unused-vars": ["error", {
89
+ "vars": "all",
90
+ "args": "after-used",
91
+ "ignoreRestSiblings": false,
92
+ "caughtErrors": "all"
93
+ }],
94
+ "no-unused-expressions": "off",
95
+ "no-use-before-define": "off",
96
+ "@typescript-eslint/no-unused-expressions": ["error"],
97
+ "no-useless-constructor": "off",
98
+ "@typescript-eslint/no-useless-constructor": ["error"],
99
+ "no-constant-condition":"off",
100
+ "comma-spacing": "off",
101
+ "@typescript-eslint/comma-spacing": ["error"],
102
+ "@typescript-eslint/unified-signatures": ["error"],
103
+ "semi": "off",
104
+ "prefer-const": "off",
105
+ "@typescript-eslint/semi": ["error"],
106
+ "@typescript-eslint/no-use-before-define": "off",
107
+ "@typescript-eslint/no-unnecessary-type-assertion": ["error"],
108
+ "@typescript-eslint/no-unnecessary-type-arguments": ["error"],
109
+ "@typescript-eslint/unbound-method": ["error"],
110
+ "@typescript-eslint/type-annotation-spacing": ["error"],
111
+ "@typescript-eslint/no-unnecessary-condition": ["off"],
112
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": ["warn"],
113
+ "@typescript-eslint/member-ordering": ["off"],
114
+ "@typescript-eslint/no-this-alias": [
115
+ "warn",
116
+ {
117
+ "allowDestructuring": true,
118
+ "allowedNames": ["_this"]
119
+ }
120
+ ],
121
+ "@typescript-eslint/no-explicit-any": ["off", {
122
+ "fixToUnknown": true,
123
+ "ignoreRestArgs": true
124
+ }],
125
+ "space-before-function-paren": "off",
126
+ "@typescript-eslint/space-before-function-paren": ["error", {
127
+ "anonymous": "never",
128
+ "named": "never",
129
+ "asyncArrow": "always"
130
+ }],
131
+ "@typescript-eslint/member-delimiter-style": ["error", {
132
+ "multiline": {
133
+ "delimiter": "semi",
134
+ "requireLast": true
135
+ },
136
+ "singleline": {
137
+ "delimiter": "semi",
138
+ "requireLast": true
139
+ }
140
+ }],
141
+ "@typescript-eslint/naming-convention": [
142
+ "error",
143
+ {
144
+ "selector": "default",
145
+ "format": ["camelCase"],
146
+ "leadingUnderscore": "forbid"
147
+ },
148
+ {
149
+ "selector": "parameter",
150
+ "format": ["camelCase"]
151
+ },
152
+ {
153
+ "selector": "property",
154
+ "format": ["snake_case"],
155
+ "filter": {
156
+ // you can expand this regex to add more allowed names
157
+ "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)$",
158
+ "match": true
159
+ }
160
+ },
161
+ {
162
+ "selector": "property",
163
+ "format": ["snake_case", "camelCase"],
164
+ "filter": {
165
+ // you can expand this regex as you find more cases that require quoting that you want to allow
166
+ "regex": "\\?$",
167
+ "match": true
168
+ }
169
+ },
170
+ {
171
+ "selector": "memberLike",
172
+ "modifiers": ["private"],
173
+ "format": ["camelCase"],
174
+ "leadingUnderscore": "require"
175
+ },
176
+ {
177
+ "selector": "memberLike",
178
+ "modifiers": ["protected"],
179
+ "format": ["camelCase"],
180
+ "leadingUnderscore": "require"
181
+ },
182
+ {
183
+ "selector": "memberLike",
184
+ "modifiers": ["private", "static"],
185
+ "format": [],
186
+ "custom": {
187
+ "regex": "^_\\$[^_]",
188
+ "match": true
189
+ }
190
+ },
191
+ {
192
+ "selector": "memberLike",
193
+ "modifiers": ["protected", "static"],
194
+ "format": [],
195
+ "custom": {
196
+ "regex": "^_\\$[^_]",
197
+ "match": true
198
+ }
199
+ },
200
+ {
201
+ "selector": "enumMember",
202
+ "format": ["UPPER_CASE"]
203
+ },
204
+ {
205
+ "selector": "variable",
206
+ "format": ["camelCase", "UPPER_CASE"]
207
+ },
208
+ {
209
+ "selector": "typeParameter",
210
+ "format": ["PascalCase"],
211
+ "prefix": ["T"]
212
+ },
213
+ {
214
+ "selector": "interface",
215
+ "format": ["PascalCase"],
216
+ "custom": {
217
+ "regex": "^I[A-Z]",
218
+ "match": true
219
+ }
220
+ },
221
+ {
222
+ "selector": "class",
223
+ "format": ["PascalCase"]
224
+ },
225
+ {
226
+ "selector": "enum",
227
+ "format": ["PascalCase"],
228
+ "custom": {
229
+ "regex": "^E[A-Z]",
230
+ "match": true
231
+ }
232
+ },
233
+ {
234
+ "selector": "typeAlias",
235
+ "format": ["PascalCase"]
236
+ }
237
+ ],
238
+ "key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
239
+ "no-multiple-empty-lines": ["error", {"max": 1, "maxEOF": 0, "maxBOF": 0}],
240
+ "no-trailing-spaces": "error",
241
+ "block-spacing":"error",
242
+ "eol-last":"error",
243
+ "space-before-blocks": "error",
244
+ "indent": "off",
245
+ "@typescript-eslint/indent": ["error", 4, {
246
+ "SwitchCase": 1,
247
+ "MemberExpression": 1,
248
+ "ArrayExpression": 1,
249
+ "ObjectExpression": 1,
250
+ "ImportDeclaration": 1,
251
+ "flatTernaryExpressions": true,
252
+ "CallExpression": {"arguments": 1},
253
+ "FunctionDeclaration": {"body": 1, "parameters": 1},
254
+ "ignoredNodes": ["TSTypeParameterInstantiation", "TemplateLiteral *"]
255
+ }],
256
+ "linebreak-style": [
257
+ "error",
258
+ "unix"
259
+ ],
260
+ "quotes": [
261
+ "error",
262
+ "single"
263
+ ]
264
+ }
265
+ }
0 commit comments