2424 "brace-style": "off",
2525 "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
2626 "camelcase": "off",
27- "@typescript-eslint/camelcase": ["error", {
28- "properties": "always",
29- "genericType": "always",
30- "ignoreDestructuring": false
31- }],
3227 "@typescript-eslint/ban-types": ["error", {
3328 "types": {
3429
6964 "@typescript-eslint/prefer-regexp-exec": "error",
7065 "@typescript-eslint/prefer-optional-chain": "error",
7166 "@typescript-eslint/no-extra-parens": "off",
72- "@typescript-eslint/class-name-casing": "error",
7367 "@typescript-eslint/no-extra-non-null-assertion": "error",
7468 "@typescript-eslint/adjacent-overload-signatures": "error",
7569 "@typescript-eslint/no-for-in-array": "error",
8579 "@typescript-eslint/consistent-type-definitions": ["error", "interface"],
8680 "func-call-spacing": "off",
8781 "@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",
9383 "@typescript-eslint/consistent-type-assertions": ["error", {
9484 "assertionStyle": "as"
9585 }],
10191 "caughtErrors": "all"
10292 }],
10393 "no-unused-expressions": "off",
94+ "no-use-before-define": "off",
10495 "@typescript-eslint/no-unused-expressions": ["error"],
10596 "no-useless-constructor": "off",
10697 "@typescript-eslint/no-useless-constructor": ["error"],
109100 "@typescript-eslint/comma-spacing": ["error"],
110101 "@typescript-eslint/unified-signatures": ["error"],
111102 "semi": "off",
103+ "prefer-const": "off",
112104 "@typescript-eslint/semi": ["error"],
113- "@typescript-eslint/no-use-before-define": ["error"] ,
105+ "@typescript-eslint/no-use-before-define": "off" ,
114106 "@typescript-eslint/no-unnecessary-type-assertion": ["error"],
115107 "@typescript-eslint/no-unnecessary-type-arguments": ["error"],
116108 "@typescript-eslint/unbound-method": ["error"],
117109 "@typescript-eslint/type-annotation-spacing": ["error"],
118110 "@typescript-eslint/no-unnecessary-condition": ["off"],
119- "@typescript-eslint/no-magic-numbers": ["off", {
120- "ignoreEnums": true
121- }],
122111 "@typescript-eslint/no-unnecessary-boolean-literal-compare": ["warn"],
123112 "@typescript-eslint/member-ordering": ["off"],
124113 "@typescript-eslint/no-this-alias": [
128117 "allowedNames": ["_this"]
129118 }
130119 ],
131- "@typescript-eslint/member-naming": ["error", {
132- "private": "^_",
133- "protected": "^_"
134- }],
135120 "@typescript-eslint/no-explicit-any": ["off", {
136121 "fixToUnknown": true,
137122 "ignoreRestArgs": true
152137 "requireLast": true
153138 }
154139 }],
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+ ],
159237 "key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
160238 "no-multiple-empty-lines": ["error", {"max": 1, "maxEOF": 0, "maxBOF": 0}],
161239 "no-trailing-spaces": "error",
162240 "block-spacing":"error",
163- "space-before-blocks": "error",
164241 "eol-last":"error",
242+ "space-before-blocks": "error",
165243 "indent": "off",
166244 "@typescript-eslint/indent": ["error", 4, {
167245 "SwitchCase": 1,
181259 "quotes": [
182260 "error",
183261 "single"
184- ],
185- "no-fallthrough": "off"
262+ ]
186263 }
187264}
0 commit comments