-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.editorconfig
496 lines (370 loc) · 16.4 KB
/
.editorconfig
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
###############################
# Core EditorConfig Options #
###############################
# All files
root = true
[*]
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = single
# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2
[*.proto]
indent_size = 2
tab_width = 2
end_of_line = lf
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8-bom
tab_width = 4
end_of_line = crlf
csharp_style_namespace_declarations = file_scoped:error
quote_type = double
###############################
# .NET Coding Conventions #
###############################
[*.{cs,vb}]
# Organize usings
dotnet_sort_system_directives_first = true
# this. preferences
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
dotnet_style_readonly_field = true:error
# Expression-level preferences
dotnet_style_object_initializer = true:error
dotnet_style_collection_initializer = true:error
dotnet_style_explicit_tuple_names = true:error
dotnet_style_null_propagation = true:error
dotnet_style_coalesce_expression = true:error
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error
dotnet_style_prefer_inferred_tuple_names = true:error
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error
dotnet_style_prefer_auto_properties = true:error
dotnet_style_prefer_conditional_expression_over_assignment = true:error
dotnet_style_prefer_conditional_expression_over_return = true:error
###############################
# Naming Conventions #
###############################
# Style Definitions
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Use PascalCase for constant fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
###############################
# C# Coding Conventions #
###############################
[*.cs]
# Expression-bodied members
csharp_style_expression_bodied_methods = true:error
csharp_style_expression_bodied_constructors = true:error
csharp_style_expression_bodied_operators = true:error
csharp_style_expression_bodied_properties = true:error
csharp_style_expression_bodied_indexers = true:error
csharp_style_expression_bodied_accessors = true:error
# Pattern matching preferences
csharp_style_pattern_matching_over_is_with_cast_check = true:error
csharp_style_pattern_matching_over_as_with_null_check = true:error
# Null-checking preferences
csharp_style_throw_expression = true:error
csharp_style_conditional_delegate_call = true:error
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
# Expression-level preferences
csharp_prefer_braces = true:error
csharp_style_deconstructed_variable_declaration = true:error
csharp_prefer_simple_default_expression = true:error
csharp_style_pattern_local_over_anonymous_function = true:error
csharp_style_inlined_variable_declaration = true:suggestion
# Don't use this. qualifier
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
# use int x = .. over Int32
dotnet_style_predefined_type_for_locals_parameters_members = true:error
# use int.MaxValue over Int32.MaxValue
dotnet_style_predefined_type_for_member_access = true:error
# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
# Brace settings
csharp_prefer_braces = true:error # Prefer curly braces even for one line of code
# prefer var for built in types
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_elsewhere = false:suggestion
# CA1825: Avoid zero-length array allocations
dotnet_diagnostic.CA1825.severity = error
# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly
dotnet_diagnostic.CA1826.severity = error
# CA1827: Do not use Count() or LongCount() when Any() can be used
dotnet_diagnostic.CA1827.severity = error
# CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used
dotnet_diagnostic.CA1828.severity = error
# CA1829: Use Length/Count property instead of Count() when available
dotnet_diagnostic.CA1829.severity = error
# CA1830: Prefer strongly-typed Append and Insert method overloads on StringBuilder
dotnet_diagnostic.CA1830.severity = error
# CA1831: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
# CA1832: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
# CA1833: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
dotnet_diagnostic.CA1831.severity = error
dotnet_diagnostic.CA1832.severity = error
dotnet_diagnostic.CA1833.severity = error
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable
dotnet_diagnostic.CA1834.severity = error
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
dotnet_diagnostic.CA1835.severity = error
# CA1836: Prefer IsEmpty over Count
dotnet_diagnostic.CA1836.severity = error
# CA1837: Use 'Environment.ProcessId'
dotnet_diagnostic.CA1837.severity = error
# CA1838: Avoid 'StringBuilder' parameters for P/Invokes
dotnet_diagnostic.CA1838.severity = error
# CA1839: Use 'Environment.ProcessPath'
dotnet_diagnostic.CA1839.severity = error
# CA1840: Use 'Environment.CurrentManagedThreadId'
dotnet_diagnostic.CA1840.severity = error
# CA1841: Prefer Dictionary.Contains methods
dotnet_diagnostic.CA1841.severity = error
# CA1842: Do not use 'WhenAll' with a single task
dotnet_diagnostic.CA1842.severity = error
# CA1843: Do not use 'WaitAll' with a single task
dotnet_diagnostic.CA1843.severity = error
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
dotnet_diagnostic.CA1844.severity = error
# CA1845: Use span-based 'string.Concat'
dotnet_diagnostic.CA1845.severity = error
# CA1846: Prefer AsSpan over Substring
dotnet_diagnostic.CA1846.severity = error
# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
dotnet_diagnostic.CA1847.severity = error
# CA1852: Seal internal types
dotnet_diagnostic.CA1852.severity = error
# CA2007: Consider calling ConfigureAwait on the awaited task
# CA2008: Do not create tasks without passing a TaskScheduler
dotnet_diagnostic.CA2008.severity = error
# CA2009: Do not call ToImmutableCollection on an ImmutableCollection value
dotnet_diagnostic.CA2009.severity = error
# CA2011: Avoid infinite recursion
dotnet_diagnostic.CA2011.severity = error
# CA2012: Use ValueTask correctly
dotnet_diagnostic.CA2012.severity = error
# CA2013: Do not use ReferenceEquals with value types
dotnet_diagnostic.CA2013.severity = error
# CA2014: Do not use stackalloc in loops.
dotnet_diagnostic.CA2014.severity = error
# CA2016: Forward the 'CancellationToken' parameter to methods that take one
dotnet_diagnostic.CA2016.severity = error
# CA2200: Rethrow to preserve stack details
dotnet_diagnostic.CA2200.severity = error
# CA2208: Instantiate argument exceptions correctly
dotnet_diagnostic.CA2208.severity = error
# CA2245: Do not assign a property to itself
dotnet_diagnostic.CA2245.severity = error
# CA2246: Assigning symbol and its member in the same statement
dotnet_diagnostic.CA2246.severity = error
# CA2249: Use string.Contains instead of string.IndexOf to improve readability.
dotnet_diagnostic.CA2249.severity = error
# IDE0005: Remove unnecessary usings
dotnet_diagnostic.IDE0005.severity = error
# IDE0011: Curly braces to surround blocks of code
dotnet_diagnostic.IDE0011.severity = suggestion
# IDE0035: Remove unreachable code
dotnet_diagnostic.IDE0035.severity = error
# IDE0043: Format string contains invalid placeholder
dotnet_diagnostic.IDE0043.severity = error
# IDE0046: Inline if statement
dotnet_diagnostic.IDE0046.severity = silent
# IDE0044: Make field readonly
dotnet_diagnostic.IDE0044.severity = error
# IDE0051: Remove unused private members
dotnet_diagnostic.IDE0051.severity = error
# IDE0055: All formatting rules
dotnet_diagnostic.IDE0055.severity = error
# IDE0059: Unnecessary assignment to a value
dotnet_diagnostic.IDE0059.severity = error
# IDE0060: Remove unused parameter
dotnet_code_quality_unused_parameters = non_public
dotnet_diagnostic.IDE0060.severity = error
# IDE0062: Make local function static
dotnet_diagnostic.IDE0062.severity = error
# CA1018: Collection init can be simplified
dotnet_diagnostic.IDE00028.severity = error
# CA1018: Collection init can be simplified
dotnet_diagnostic.IDE0028.severity = error
# CA1018: Mark attributes with AttributeUsageAttribute
dotnet_diagnostic.CA1018.severity = error
# CA1507: Use nameof to express symbol names
dotnet_diagnostic.CA1507.severity = error
# CA1802: Use literals where appropriate
dotnet_diagnostic.CA1802.severity = error
# CA1805: Do not initialize unnecessarily
dotnet_diagnostic.CA1805.severity = error
# CA1810: Do not initialize unnecessarily
dotnet_diagnostic.CA1810.severity = error
# CA1822: Make member static
dotnet_diagnostic.CA1822.severity = error
# CA1823: Avoid zero-length array allocations
dotnet_diagnostic.CA1825.severity = error
# CA1826: Do not use Enumerable methods on indexable collections. Instead use the collection directly
dotnet_diagnostic.CA1826.severity = error
# CA1827: Do not use Count() or LongCount() when Any() can be used
dotnet_diagnostic.CA1827.severity = error
# CA1829: Use Length/Count property instead of Count() when available
dotnet_diagnostic.CA1829.severity = error
# CA1834: Consider using 'StringBuilder.Append(char)' when applicable
dotnet_diagnostic.CA1834.severity = error
# CA1835: Prefer the 'Memory'-based overloads for 'ReadAsync' and 'WriteAsync'
dotnet_diagnostic.CA1835.severity = error
# CA1837: Use 'Environment.ProcessId'
dotnet_diagnostic.CA1837.severity = error
# CA1838: Avoid 'StringBuilder' parameters for P/Invokes
dotnet_diagnostic.CA1838.severity = error
# CA1841: Prefer Dictionary.Contains methods
dotnet_diagnostic.CA1841.severity = error
# CA1844: Provide memory-based overrides of async methods when subclassing 'Stream'
dotnet_diagnostic.CA1844.severity = error
# CA1845: Use span-based 'string.Concat'
dotnet_diagnostic.CA1845.severity = error
# collection init simplification
dotnet_diagnostic.IDE0090.severity = error
# unused private members
dotnet_diagnostic.IDE0052.severity = error
# CA1846: Prefer AsSpan over Substring
dotnet_diagnostic.CA1846.severity = error
# CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
dotnet_diagnostic.CA1847.severity = error
# CA1852: Seal internal types
dotnet_diagnostic.CA1852.severity = error
# CA1008: Enums should have zero value
dotnet_diagnostic.CA1008.severity = suggestion
# CA2008: Do not create tasks without passing a TaskScheduler
dotnet_diagnostic.CA2008.severity = error
# CA2012: Use ValueTask correctly
dotnet_diagnostic.CA2012.severity = error
# CA2249: Use string.Contains instead of string.IndexOf to improve readability.
dotnet_diagnostic.CA2249.severity = error
# IDE0005: Remove unnecessary usings
dotnet_diagnostic.IDE0005.severity = error
# IDE0044: Make field readonly
dotnet_diagnostic.IDE0044.severity = error
# IDE0051: Remove unused private members
dotnet_diagnostic.IDE0051.severity = error
# IDE0059: Unnecessary assignment to a value
dotnet_diagnostic.IDE0059.severity = error
# IDE0060: Remove unused parameters
dotnet_diagnostic.IDE0060.severity = error
# IDE0062: Make local function static
dotnet_diagnostic.IDE0062.severity = error
# CA2016: Forward the 'CancellationToken' parameter to methods that take one
dotnet_diagnostic.CA2016.severity = error
# CA1848: Use LoggerMessage for improved performance
dotnet_diagnostic.CA1848.severity = none
# CA1014: Mark assemblies with CLSCompliant
dotnet_diagnostic.CA1014.severity = none
# CA1014: Internal class never instantiated
dotnet_diagnostic.CA1812.severity = none
# CA1062: In externally visible method validate paramter request is non null before using it.
dotnet_diagnostic.CA1062.severity = none
# CA1002: Do not expose generic lists
dotnet_diagnostic.CA1002.severity = none
# CA1035: Do not expose generic lists
dotnet_diagnostic.CA1035.severity = suggestion
# CA1308: Normalize strings to uppercase
dotnet_diagnostic.CA1308.severity = none
# CA1028: If possible, make the underlying type of Enum to byte
dotnet_diagnostic.CA1028.severity = none
# CA1508: Avoid dead code
dotnet_diagnostic.CA1508.severity = none
dotnet_diagnostic.CA2007.severity = none
# CA1035: Behaviour of ToString varies on user locale
dotnet_diagnostic.CA1035.severity = none
# CA1305: Behaviour of ToString varies on user locale
dotnet_diagnostic.CA1305.severity = none
# CA1307: Behaviour of ToString varies on user locale
dotnet_diagnostic.CA1307.severity = none
# CA1304: ToLower() differ with user locale
dotnet_diagnostic.CA1304.severity = none
# CA1304: StartsWith() differ with user locale
dotnet_diagnostic.CA1304.severity = none
###############################
# C# Formatting Rules #
###############################
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = file_scoped:error
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
[*.js]
indent_size = 2
tab_width = 2
end_of_line = lf
[*.ts]
indent_size = 2
tab_width = 2
end_of_line = lf
[*.css]
indent_size = 2
tab_width = 2
end_of_line = lf
[*.scss]
indent_size = 2
tab_width = 2
end_of_line = lf