-
Notifications
You must be signed in to change notification settings - Fork 15
/
.editorconfig
326 lines (245 loc) · 14.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
root = true
# Must-have extension for: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.EditorConfig
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
[*.{html,cshtml}]
indent_size = 2
# Ref: https://www.jetbrains.com/help/resharper/2018.1/EditorConfig_Razor_CSharp_RazorCodeStylePageImplSchema.html
linebreaks_around_razor_statements = true
html_blank_lines_around_razor_functions = 2
blank_lines_around_razor_helpers = 1
blank_lines_around_razor_sections = 1
spaces_around_eq_in_attribute = false
space_after_last_attribute = false
space_before_self_closing = false
attribute_style = do_not_touch
attribute_indent = align_by_first_attribute
sort_class_selectors = false
linebreak_before_all_elements = false
extra_spaces = leave_all
quote_style = doublequoted
delete_quotes_from_solid_values = false
normalize_tag_names = true
[*.{scss,css}]
#Ref: https://www.jetbrains.com/help/resharper/2018.1/EditorConfig_CSS_CodeLayoutPageSchema.html
# (note these settings don't matter much - prettier takes over when committing files anyway)
declarations_style = separate_lines
brace_style = end_of_line
keep_user_linebreaks = true
keep_blank_lines_between_declarations = 1
space_around_selector_operator = true
[*.{js,ts}]
#Ref: https://www.jetbrains.com/help/resharper/2018.1/EditorConfig_JAVA_SCRIPT_BracesPageSchema.html
# (note these settings don't matter much - prettier takes over when committing files anyway)
empty_block_style = together
function_braces = end_of_line
function_in_invocation_braces = end_of_line
control_statements_braces = end_of_line
indent_pars = outside_and_inside
force_control_statements_braces = do_not_change
indent_switch_labels = true
space_before_colon_in_type_annotation = false
space_around_pipe_or_amper_in_type_usage = false
[*.xml]
indent_size = 2
[*.json]
indent_size = 4
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
[*.{cs,cshtml}]
charset = utf-8-bom
[*.{cs,ts,js,scss,css}]
trim_trailing_whitespace = true
insert_final_newline = true
# Line length in .prettierrc
max_line_length = 120
[*]
## Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#language-conventions
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#this_and_me
dotnet_style_qualification_for_field = true:error
dotnet_style_qualification_for_property = true:error
dotnet_style_qualification_for_method = true:suggestion
dotnet_style_qualification_for_event = true:error
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#language_keywords
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = false:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#normalize_modifiers
dotnet_style_require_accessibility_modifiers = always:error
dotnet_style_readonly_field = true:error
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#parentheses
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#expression_level
dotnet_style_object_initializer=true:suggestion
dotnet_style_collection_initializer=true:suggestion
dotnet_style_explicit_tuple_names=true:warning
dotnet_style_prefer_inferred_tuple_names = false:none
dotnet_style_prefer_inferred_anonymous_type_member_names=true:suggestion
dotnet_style_prefer_auto_properties=true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method=true:warning
dotnet_style_prefer_conditional_expression_over_assignment=true:suggestion
dotnet_style_prefer_conditional_expression_over_return=true:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#null_checking
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#implicit-and-explicit-types
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = false:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#expression_bodied_members
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
csharp_style_expression_bodied_constructors = false:warning
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#pattern_matching
csharp_style_pattern_matching_over_is_with_cast_check=true:warning
csharp_style_pattern_matching_over_as_with_null_check=true:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#inlined_variable_declarations
csharp_style_inlined_variable_declaration = true:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#expression_level_csharp
csharp_prefer_simple_default_expression=true:warning
csharp_style_deconstructed_variable_declaration=true:suggestion
csharp_style_pattern_local_over_anonymous_function=true:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#null_checking_csharp
csharp_style_throw_expression=true:suggestion
csharp_style_conditional_delegate_call=true:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#code_block
csharp_prefer_braces=false:suggestion
## Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#formatting-conventions
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#usings
dotnet_sort_system_directives_first = false:warning
dotnet_separate_import_directive_groups = true:suggestion
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#newline
csharp_new_line_before_open_brace = all:warning
csharp_new_line_before_else = false:warning
csharp_new_line_before_catch = false:warning
csharp_new_line_before_finally = true:warning
csharp_new_line_before_members_in_object_initializers = true:warning
csharp_new_line_before_members_in_anonymous_types = true:warning
csharp_new_line_between_query_expression_clauses = true:warning
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#indent
csharp_indent_case_contents = true:warning
csharp_indent_switch_labels = true:warning
csharp_indent_labels = flush_left:warning
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#spacing
csharp_space_after_cast = true:warning
csharp_space_after_keywords_in_control_flow_statements = true:warning
csharp_space_between_method_declaration_parameter_list_parentheses = false:warning
csharp_space_between_method_call_parameter_list_parentheses = false:warning
csharp_space_between_parentheses = expressions:silent
csharp_space_before_colon_in_inheritance_clause = true:warning
csharp_space_after_colon_in_inheritance_clause = true:warning
csharp_space_around_binary_operators = before_and_after:suggestion
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false:warning
csharp_space_between_method_call_name_and_opening_parenthesis = false:warning
csharp_space_between_method_call_empty_parameter_list_parentheses = false:warning
# Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017#wrapping
csharp_preserve_single_line_statements = false:suggestion
csharp_preserve_single_line_blocks = true:silent
## Ref: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions?view=vs-2017
# By default, name items with PascalCase
dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.all_members.applicable_kinds = namespace, class, struct, interface, enum, property, method, event, delegate, type_parameter, local_function
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# Public members must be capitalized (public_members_must_be_capitalized)
dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
dotnet_naming_symbols.public_symbols.applicable_kinds = property,method,field,event,delegate
dotnet_naming_symbols.public_symbols.applicable_accessibilities = public
dotnet_naming_symbols.public_symbols.required_modifiers = readonly
dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style
dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper
dotnet_naming_rule.public_members_must_be_capitalized.severity = suggestion
# Non-private static fields are PascalCase
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style
dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected internal, private protected
dotnet_naming_symbols.non_private_static_fields.required_modifiers = static
dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
# Constants are PascalCase
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_style.constant_style.capitalization = pascal_case
# Instance fields are camelCase and start with _
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
dotnet_naming_symbols.instance_fields.applicable_kinds = field
dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix = _
# Local functions are PascalCase
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
dotnet_naming_style.local_function_style.capitalization = pascal_case
# Locals are camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
dotnet_naming_rule.locals_should_be_camel_case.symbols = local
dotnet_naming_rule.locals_should_be_camel_case.style = locals_style
dotnet_naming_symbols.locals_style.applicable_kinds = local
dotnet_naming_style.locals_style.capitalization = camel_case
# Static fields are PascalCased and are not prefixed
dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_style.static_field_style.capitalization = pascal_case
# Ref: https://www.jetbrains.com/help/resharper/2018.1/EditorConfig_Index.html
add_imports_to_deepest_scope = true
default_private_modifier = explicit
arguments_literal = named
arguments_string_literal = named
arguments_named = named
arguments_anonymous_function = named
braces_for_ifelse = required_for_multiline_statement
braces_for_for = required
braces_for_foreach = required
braces_for_while = required_for_multiline
braces_for_dowhile = required
braces_for_dowhile = required
braces_for_using = required_for_multiline
braces_for_lock = required
braces_for_fixed = required
braces_redundant = true
local_function_body = expression_body
constructor_or_destructor_body = block_body
force_attribute_style = separate
csharp_keep_user_linebreaks = true
keep_existing_attribute_arrangement = false
place_attribute_on_same_line = if_owner_is_single_line
csharp_wrap_parameters_style = chop_if_long
keep_existing_declaration_parens_arrangement = false
wrap_before_declaration_lpar = false
wrap_after_declaration_lpar = true
wrap_before_declaration_rpar = true
place_constructor_initializer_on_same_line = true
csharp_wrap_arguments_style = chop_if_long
csharp_wrap_after_dot_in_method_calls = true
csharp_wrap_chained_method_calls = chop_if_long
csharp_wrap_before_binary_opsign = false
csharp_wrap_linq_expressions = chop_always
csharp_wrap_before_linq_expression = true
csharp_place_linq_into_on_new_line = false
csharp_extra_spaces = remove_all
space_before_colon_in_inheritance_clause = true
space_after_colon_in_inheritance_clause = true
space_before_type_parameter_constraint_colon= true
space_after_type_parameter_constraint_colon= true
[*.cs]
# CS0660: Type defines operator == or operator != but does not override Object.Equals(object o)
dotnet_diagnostic.CS0660.severity = none