1
- # Version: 1.3.2 (Using https://semver.org/)
2
- # Updated: 2019-08-04
1
+ # Version: 4.0.0 (Using https://semver.org/)
2
+ # Updated: 2021-10-12
3
3
# See https://github.com/RehanSaeed/EditorConfig/releases for release notes.
4
4
# See https://github.com/RehanSaeed/EditorConfig for updates to this file.
5
5
# See http://EditorConfig.org for more information about .editorconfig files.
@@ -28,15 +28,15 @@ trim_trailing_whitespace = true
28
28
indent_style = tab
29
29
30
30
# Visual Studio XML Project Files
31
- [* .{csproj,vbproj,vcxproj,vcxproj .filters,proj,projitems,shproj} ]
31
+ [* .{csproj,vbproj,vcxproj.filters,proj,projitems,shproj} ]
32
32
indent_size = 2
33
33
34
- # Various XML Configuration Files
34
+ # XML Configuration Files
35
35
[* .{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct} ]
36
36
indent_size = 2
37
37
38
38
# JSON Files
39
- [* .{json,json5} ]
39
+ [* .{json,json5,webmanifest } ]
40
40
indent_size = 2
41
41
42
42
# YAML Files
@@ -48,7 +48,7 @@ indent_size = 2
48
48
trim_trailing_whitespace = false
49
49
50
50
# Web Files
51
- [* .{htm,html,js,ts,tsx,css,sass,scss,less,svg,vue} ]
51
+ [* .{htm,html,js,jsm, ts,tsx,cjs,cts,ctsx,mjs,mts,mtsx, css,sass,scss,less,pcss ,svg,vue} ]
52
52
indent_size = 2
53
53
54
54
# Batch Files
@@ -59,69 +59,81 @@ end_of_line = crlf
59
59
[* .sh ]
60
60
end_of_line = lf
61
61
62
+ # Makefiles
63
+ [Makefile ]
64
+ indent_style = tab
65
+
62
66
# #########################################
63
- # .NET Language Conventions
64
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions
67
+ # Default .NET Code Style Severities
68
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope
65
69
# #########################################
66
70
67
- # .NET Code Style Settings
68
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings
69
- [* .{cs,csx,cake,vb} ]
71
+ [* .{cs,csx,cake,vb,vbx} ]
72
+ # Default Severity for all .NET Code Style rules below
73
+ dotnet_analyzer_diagnostic.severity = warning
74
+
75
+ # #########################################
76
+ # Language Rules
77
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules
78
+ # #########################################
79
+
80
+ # .NET Style Rules
81
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#net-style-rules
82
+ [* .{cs,csx,cake,vb,vbx} ]
70
83
# "this." and "Me." qualifiers
71
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
72
84
dotnet_style_qualification_for_field = true :warning
73
85
dotnet_style_qualification_for_property = true :warning
74
86
dotnet_style_qualification_for_method = true :warning
75
87
dotnet_style_qualification_for_event = true :warning
76
88
# Language keywords instead of framework type names for type references
77
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords
78
89
dotnet_style_predefined_type_for_locals_parameters_members = true :warning
79
90
dotnet_style_predefined_type_for_member_access = true :warning
80
91
# Modifier preferences
81
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers
82
92
dotnet_style_require_accessibility_modifiers = always:warning
83
- csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
84
- visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async
93
+ csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
94
+ visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:warning
85
95
dotnet_style_readonly_field = true :warning
86
96
# Parentheses preferences
87
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences
88
97
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
89
98
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
90
99
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
91
- dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
100
+ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
92
101
# Expression-level preferences
93
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
94
102
dotnet_style_object_initializer = true :warning
95
103
dotnet_style_collection_initializer = true :warning
96
104
dotnet_style_explicit_tuple_names = true :warning
97
105
dotnet_style_prefer_inferred_tuple_names = true :warning
98
106
dotnet_style_prefer_inferred_anonymous_type_member_names = true :warning
99
107
dotnet_style_prefer_auto_properties = true :warning
100
- dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
101
108
dotnet_style_prefer_conditional_expression_over_assignment = false :suggestion
109
+ dotnet_diagnostic.IDE0045.severity = suggestion
102
110
dotnet_style_prefer_conditional_expression_over_return = false :suggestion
111
+ dotnet_diagnostic.IDE0046.severity = suggestion
103
112
dotnet_style_prefer_compound_assignment = true :warning
113
+ dotnet_style_prefer_simplified_interpolation = true :warning
114
+ dotnet_style_prefer_simplified_boolean_expressions = true :warning
104
115
# Null-checking preferences
105
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences
106
116
dotnet_style_coalesce_expression = true :warning
107
117
dotnet_style_null_propagation = true :warning
108
- # Parameter preferences
109
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences
110
- dotnet_code_quality_unused_parameters = all:warning
111
- # More style options (Undocumented)
112
- # https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641
113
- dotnet_style_operator_placement_when_wrapping = end_of_line
114
-
115
- # C# Code Style Settings
116
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings
118
+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
119
+ # File header preferences
120
+ # file_header_template = <copyright file="{fileName}" company="PROJECT-AUTHOR">\n© PROJECT-AUTHOR\n</copyright>
121
+ # If you use StyleCop, you'll need to disable SA1636: File header copyright text should match.
122
+ # dotnet_diagnostic.SA1636.severity = none
123
+ # Undocumented
124
+ dotnet_style_operator_placement_when_wrapping = end_of_line:warning
125
+ csharp_style_prefer_null_check_over_type_check = true :warning
126
+ dotnet_style_namespace_match_folder = true :suggestion
127
+ dotnet_diagnostic.IDE0130.severity = suggestion
128
+
129
+ # C# Style Rules
130
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/language-rules#c-style-rules
117
131
[* .{cs,csx,cake} ]
118
- # Implicit and explicit types
119
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types
132
+ # 'var' preferences
120
133
csharp_style_var_for_built_in_types = true :warning
121
134
csharp_style_var_when_type_is_apparent = true :warning
122
135
csharp_style_var_elsewhere = true :warning
123
136
# Expression-bodied members
124
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
125
137
csharp_style_expression_bodied_methods = true :warning
126
138
csharp_style_expression_bodied_constructors = true :warning
127
139
csharp_style_expression_bodied_operators = true :warning
@@ -130,47 +142,66 @@ csharp_style_expression_bodied_indexers = true:warning
130
142
csharp_style_expression_bodied_accessors = true :warning
131
143
csharp_style_expression_bodied_lambdas = true :warning
132
144
csharp_style_expression_bodied_local_functions = true :warning
133
- # Pattern matching
134
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching
145
+ # Pattern matching preferences
135
146
csharp_style_pattern_matching_over_is_with_cast_check = true :warning
136
147
csharp_style_pattern_matching_over_as_with_null_check = true :warning
137
- # Inlined variable declarations
138
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations
139
- csharp_style_inlined_variable_declaration = true :warning
148
+ csharp_style_prefer_switch_expression = true : warning
149
+ csharp_style_prefer_pattern_matching = true : warning
150
+ csharp_style_prefer_not_pattern = true :warning
140
151
# Expression-level preferences
141
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
152
+ csharp_style_inlined_variable_declaration = true : warning
142
153
csharp_prefer_simple_default_expression = true :warning
154
+ csharp_style_pattern_local_over_anonymous_function = true :warning
155
+ csharp_style_deconstructed_variable_declaration = true :warning
156
+ csharp_style_prefer_index_operator = true :warning
157
+ csharp_style_prefer_range_operator = true :warning
158
+ csharp_style_implicit_object_creation_when_type_is_apparent = true :warning
143
159
# "Null" checking preferences
144
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences
145
160
csharp_style_throw_expression = true :warning
146
161
csharp_style_conditional_delegate_call = true :warning
147
162
# Code block preferences
148
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences
149
163
csharp_prefer_braces = true :warning
150
- # Unused value preferences
151
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences
152
- csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
153
- csharp_style_unused_value_assignment_preference = discard_variable:suggestion
154
- # Index and range preferences
155
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
156
- csharp_style_prefer_index_operator = true :warning
157
- csharp_style_prefer_range_operator = true :warning
158
- # Miscellaneous preferences
159
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
160
- csharp_style_deconstructed_variable_declaration = true :warning
161
- csharp_style_pattern_local_over_anonymous_function = true :warning
164
+ csharp_prefer_simple_using_statement = true :suggestion
165
+ dotnet_diagnostic.IDE0063.severity = suggestion
166
+ # 'using' directive preferences
162
167
csharp_using_directive_placement = inside_namespace:warning
168
+ # Modifier preferences
163
169
csharp_prefer_static_local_function = true :warning
164
- csharp_prefer_simple_using_statement = false :warning
170
+ # Undocumented
171
+ csharp_style_namespace_declarations = file_scoped:warning
165
172
166
173
# #########################################
167
- # .NET Formatting Conventions
168
- # https://docs.microsoft.com/visualstudio/ide/editorconfig- code-style-settings-reference#formatting-conventions
174
+ # Unnecessary Code Rules
175
+ # https://docs.microsoft.com/dotnet/fundamentals/ code-analysis/ style-rules/unnecessary-code-rules
169
176
# #########################################
170
177
171
- # Organize usings
172
- # https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#organize-using-directives
178
+ # .NET Unnecessary code rules
179
+ [* .{cs,csx,cake,vb,vbx} ]
180
+ dotnet_code_quality_unused_parameters = all:warning
181
+ dotnet_remove_unnecessary_suppression_exclusions = none:warning
182
+
183
+ # C# Unnecessary code rules
184
+ [* .{cs,csx,cake} ]
185
+ csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
186
+ dotnet_diagnostic.IDE0058.severity = suggestion
187
+ csharp_style_unused_value_assignment_preference = discard_variable:suggestion
188
+ dotnet_diagnostic.IDE0059.severity = suggestion
189
+
190
+ # #########################################
191
+ # Formatting Rules
192
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules
193
+ # #########################################
194
+
195
+ # .NET formatting rules
196
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#net-formatting-rules
197
+ [* .{cs,csx,cake,vb,vbx} ]
198
+ # Organize using directives
173
199
dotnet_sort_system_directives_first = true
200
+ dotnet_separate_import_directive_groups = false
201
+
202
+ # C# formatting rules
203
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#c-formatting-rules
204
+ [* .{cs,csx,cake} ]
174
205
# Newline options
175
206
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options
176
207
csharp_new_line_before_open_brace = all
@@ -212,17 +243,17 @@ csharp_space_around_declaration_statements = false
212
243
csharp_space_before_open_square_brackets = false
213
244
csharp_space_between_empty_square_brackets = false
214
245
csharp_space_between_square_brackets = false
215
- # Wrapping options
246
+ # Wrap options
216
247
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options
217
248
csharp_preserve_single_line_statements = false
218
249
csharp_preserve_single_line_blocks = true
219
250
220
251
# #########################################
221
- # .NET Naming Conventions
222
- # https://docs.microsoft.com/visualstudio/ide/editorconfig- naming-conventions
252
+ # .NET Naming Rules
253
+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ naming-rules
223
254
# #########################################
224
255
225
- [* .{cs,csx,cake,vb} ]
256
+ [* .{cs,csx,cake,vb,vbx } ]
226
257
227
258
# #########################################
228
259
# Styles
@@ -244,7 +275,7 @@ dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T
244
275
dotnet_naming_style.disallowed_style.capitalization = pascal_case
245
276
dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____
246
277
dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____
247
- # internal_error_style - This style should never occur... if it does, it's indicates a bug in file or in the parser using the file
278
+ # internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file
248
279
dotnet_naming_style.internal_error_style.capitalization = pascal_case
249
280
dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____
250
281
dotnet_naming_style.internal_error_style.required_suffix = ____INTERNAL_ERROR____
@@ -414,4 +445,4 @@ dotnet_naming_rule.parameters_rule.severity = warning
414
445
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
415
446
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
416
447
# OTHER DEALINGS IN THE SOFTWARE.
417
- # #########################################
448
+ # #########################################
0 commit comments