microsoft/TypeAgent

Public

mirrored from https://github.com/microsoft/TypeAgentAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
19fbcb1e67c4945fbd2f8ed985aefc8e8a44ee74

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

dotnet/.editorconfig

388lines · modecode

1# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2
3###############################
4# Core EditorConfig Options #
5###############################
6root = true
7
8# All files
9[*]
10indent_style = space
11end_of_line = lf
12
13# XML project files
14[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
15indent_size = 2
16
17# XML config files
18[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
19indent_size = 2
20
21# YAML config files
22[*.{yml,yaml}]
23tab_width = 2
24indent_size = 2
25insert_final_newline = true
26trim_trailing_whitespace = true
27
28# JSON config files
29[*.json]
30tab_width = 2
31indent_size = 2
32insert_final_newline = false
33trim_trailing_whitespace = true
34
35# Typescript files
36[*.{ts,tsx}]
37insert_final_newline = true
38trim_trailing_whitespace = true
39tab_width = 4
40indent_size = 4
41file_header_template = Copyright (c) Microsoft. All rights reserved.
42
43# Stylesheet files
44[*.{css,scss,sass,less}]
45insert_final_newline = true
46trim_trailing_whitespace = true
47tab_width = 4
48indent_size = 4
49
50# Code files
51[*.{cs,csx,vb,vbx}]
52tab_width = 4
53indent_size = 4
54insert_final_newline = true
55trim_trailing_whitespace = true
56charset = utf-8-bom
57file_header_template = Copyright (c) Microsoft. All rights reserved.
58
59###############################
60# .NET Coding Conventions #
61###############################
62[*.{cs,vb}]
63# Organize usings
64dotnet_sort_system_directives_first = true
65# this. preferences
66dotnet_style_qualification_for_field = true:error
67dotnet_style_qualification_for_property = true:error
68dotnet_style_qualification_for_method = true:error
69dotnet_style_qualification_for_event = true:error
70# Language keywords vs BCL types preferences
71dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
72dotnet_style_predefined_type_for_member_access = true:suggestion
73# Parentheses preferences
74dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
75dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
76dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
77dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
78# Modifier preferences
79dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
80dotnet_style_readonly_field = true:suggestion
81# Expression-level preferences
82dotnet_style_object_initializer = true:suggestion
83dotnet_style_collection_initializer = true:suggestion
84dotnet_style_explicit_tuple_names = true:suggestion
85dotnet_style_null_propagation = true:suggestion
86dotnet_style_coalesce_expression = true:suggestion
87dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
88dotnet_style_prefer_inferred_tuple_names = true:suggestion
89dotnet_style_prefer_inferred_anonymous_type_member_names = true:silent
90dotnet_style_prefer_auto_properties = true:suggestion
91dotnet_style_prefer_conditional_expression_over_assignment = true:silent
92dotnet_style_prefer_conditional_expression_over_return = true:silent
93dotnet_style_prefer_simplified_interpolation = true:suggestion
94dotnet_style_operator_placement_when_wrapping = beginning_of_line
95dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
96dotnet_style_prefer_compound_assignment = true:suggestion
97# Code quality rules
98dotnet_code_quality_unused_parameters = all:suggestion
99
100[*.cs]
101
102dotnet_analyzer_diagnostic.severity = warning
103
104# Note: these settings cause "dotnet format" to fix the code. You should review each change if you uses "dotnet format".
105dotnet_diagnostic.RCS1036.severity = warning # Remove unnecessary blank line.
106dotnet_diagnostic.RCS1037.severity = warning # Remove trailing white-space.
107dotnet_diagnostic.RCS1097.severity = warning # Remove redundant 'ToString' call.
108dotnet_diagnostic.RCS1138.severity = warning # Add summary to documentation comment.
109dotnet_diagnostic.RCS1139.severity = warning # Add summary element to documentation comment.
110dotnet_diagnostic.RCS1168.severity = warning # Parameter name 'foo' differs from base name 'bar'.
111dotnet_diagnostic.RCS1175.severity = warning # Unused 'this' parameter 'operation'.
112dotnet_diagnostic.RCS1192.severity = warning # Unnecessary usage of verbatim string literal.
113dotnet_diagnostic.RCS1194.severity = warning # Implement exception constructors.
114dotnet_diagnostic.RCS1211.severity = warning # Remove unnecessary else clause.
115dotnet_diagnostic.RCS1214.severity = warning # Unnecessary interpolated string.
116dotnet_diagnostic.RCS1225.severity = warning # Make class sealed.
117dotnet_diagnostic.RCS1232.severity = warning # Order elements in documentation comment.
118
119
120# Commented out because `dotnet format` removes the xmldoc element, while we should add the missing documentation instead.
121# dotnet_diagnostic.RCS1228.severity = warning # Unused element in documentation comment.
122
123# Diagnostics elevated as warnings
124# dotnet_diagnostic.CA1000.severity = warning # Do not declare static members on generic types
125# dotnet_diagnostic.CA1031.severity = warning # Do not catch general exception types
126dotnet_diagnostic.CA1050.severity = warning # Declare types in namespaces
127dotnet_diagnostic.CA1063.severity = warning # Implement IDisposable correctly
128dotnet_diagnostic.CA1064.severity = warning # Exceptions should be public
129dotnet_diagnostic.CA1310.severity = none # Exceptions should be public
130dotnet_diagnostic.CA1416.severity = warning # Validate platform compatibility
131dotnet_diagnostic.CA1508.severity = warning # Avoid dead conditional code
132# dotnet_diagnostic.CA1852.severity = warning # Sealed classes
133dotnet_diagnostic.CA1859.severity = warning # Use concrete types when possible for improved performance
134dotnet_diagnostic.CA1860.severity = warning # Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance
135# dotnet_diagnostic.CA2000.severity = warning # Call System.IDisposable.Dispose on object before all references to it are out of scope
136dotnet_diagnostic.CA2201.severity = warning # Exception type System.Exception is not sufficiently specific
137
138dotnet_diagnostic.IDE0001.severity = warning # Simplify name
139# dotnet_diagnostic.IDE0005.severity = warning # Remove unnecessary using directives
140dotnet_diagnostic.IDE0011.severity = warning # Add braces
141dotnet_diagnostic.IDE0018.severity = warning # Inline variable declaration
142dotnet_diagnostic.IDE0032.severity = warning # Use auto-implemented property
143dotnet_diagnostic.IDE0034.severity = warning # Simplify 'default' expression
144dotnet_diagnostic.IDE0035.severity = warning # Remove unreachable code
145dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references
146dotnet_diagnostic.IDE0050.severity = warning # Convert anonymous type to tuple
147dotnet_diagnostic.IDE0051.severity = warning # Remove unused private member
148dotnet_diagnostic.IDE0055.severity = warning # Formatting rule
149dotnet_diagnostic.IDE0060.severity = warning # Remove unused parameter
150dotnet_diagnostic.IDE0070.severity = warning # Use 'System.HashCode.Combine'
151dotnet_diagnostic.IDE0071.severity = warning # Simplify interpolation
152dotnet_diagnostic.IDE0073.severity = warning # Require file header
153dotnet_diagnostic.IDE0082.severity = warning # Convert typeof to nameof
154# dotnet_diagnostic.IDE0130.severity = warning # Namespace does not match folder structure
155dotnet_diagnostic.IDE0161.severity = warning # Use file-scoped namespace
156
157#######################################
158#
159# Suppressed diagnostics
160#
161#######################################
162dotnet_diagnostic.RCS1085.severity = none # Use auto-implemented property.
163
164dotnet_diagnostic.CA1002.severity = none # Change 'List<string>' in '...' to use 'Collection<T>' ...
165dotnet_diagnostic.CA1032.severity = none # We're using RCS1194 which seems to cover more ctors
166dotnet_diagnostic.CA1034.severity = none # Do not nest type. Alternatively, change its accessibility so that it is not externally visible
167dotnet_diagnostic.CA1062.severity = none # Disable null check, C# already does it for us
168dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters
169dotnet_diagnostic.CA1304.severity = none # Specify CultureInfo
170dotnet_diagnostic.CA1305.severity = none # Specify IFormatProvider
171dotnet_diagnostic.CA1311.severity = none # Specify a culture or use an invariant version
172dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
173dotnet_diagnostic.CA1707.severity = none # Identifiers should not contain underscores
174dotnet_diagnostic.CA1711.severity = none # Identifiers should not have incorrect suffix
175dotnet_diagnostic.CA1716.severity = none # Identifiers should not match keywords
176dotnet_diagnostic.CA1720.severity = none #
177dotnet_diagnostic.CA1725.severity = none # Parameter names should match base declaration
178dotnet_diagnostic.CA1805.severity = none # Member is explicitly initialized to its default value
179dotnet_diagnostic.CA1822.severity = none # Member does not access instance data and can be marked as static
180dotnet_diagnostic.CA1848.severity = none # For improved performance, use the LoggerMessage delegates
181dotnet_diagnostic.CA1852.severity = none # Seal internal types
182dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task
183dotnet_diagnostic.CA2208.severity = none #
184dotnet_diagnostic.CA2225.severity = none # Operator overloads have named alternates
185dotnet_diagnostic.CA2227.severity = none # Change to be read-only by removing the property setter
186dotnet_diagnostic.CA2253.severity = none # Named placeholders in the logging message template should not be comprised of only numeric characters
187
188dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave
189dotnet_diagnostic.xUnit1004.severity = none # Test methods should not be skipped. Remove the Skip property to start running the test again.
190
191dotnet_diagnostic.RCS1021.severity = none # Use expression-bodied lambda.
192dotnet_diagnostic.RCS1032.severity = none # Remove redundant parentheses.
193dotnet_diagnostic.RCS1061.severity = none # Merge 'if' with nested 'if'.
194dotnet_diagnostic.RCS1069.severity = none # Remove unnecessary case label.
195dotnet_diagnostic.RCS1074.severity = none # Remove redundant constructor.
196dotnet_diagnostic.RCS1077.severity = none # Optimize LINQ method call.
197dotnet_diagnostic.RCS1118.severity = none # Mark local variable as const.
198dotnet_diagnostic.RCS1124.severity = none # Inline local variable.
199dotnet_diagnostic.RCS1129.severity = none # Remove redundant field initialization.
200dotnet_diagnostic.RCS1140.severity = none # Add exception to documentation comment.
201dotnet_diagnostic.RCS1141.severity = none # Add 'param' element to documentation comment.
202dotnet_diagnostic.RCS1142.severity = none # Add 'typeparam' element to documentation comment.
203dotnet_diagnostic.RCS1146.severity = none # Use conditional access.
204dotnet_diagnostic.RCS1151.severity = none # Remove redundant cast.
205dotnet_diagnostic.RCS1158.severity = none # Static member in generic type should use a type parameter.
206dotnet_diagnostic.RCS1161.severity = none # Enum should declare explicit value
207dotnet_diagnostic.RCS1163.severity = none # Unused parameter 'foo'.
208dotnet_diagnostic.RCS1170.severity = none # Use read-only auto-implemented property.
209dotnet_diagnostic.RCS1173.severity = none # Use coalesce expression instead of 'if'.
210dotnet_diagnostic.RCS1181.severity = none # Convert comment to documentation comment.
211dotnet_diagnostic.RCS1186.severity = none # Use Regex instance instead of static method.
212dotnet_diagnostic.RCS1188.severity = none # Remove redundant auto-property initialization.
213dotnet_diagnostic.RCS1189.severity = none # Add region name to #endregion.
214dotnet_diagnostic.RCS1197.severity = none # Optimize StringBuilder.AppendLine call.
215dotnet_diagnostic.RCS1201.severity = none # Use method chaining.
216dotnet_diagnostic.RCS1205.severity = none # Order named arguments according to the order of parameters.
217dotnet_diagnostic.RCS1212.severity = none # Remove redundant assignment.
218dotnet_diagnostic.RCS1217.severity = none # Convert interpolated string to concatenation.
219dotnet_diagnostic.RCS1222.severity = none # Merge preprocessor directives.
220dotnet_diagnostic.RCS1226.severity = none # Add paragraph to documentation comment.
221dotnet_diagnostic.RCS1229.severity = none # Use async/await when necessary.
222dotnet_diagnostic.RCS1234.severity = none # Enum duplicate value
223dotnet_diagnostic.RCS1238.severity = none # Avoid nested ?: operators.
224dotnet_diagnostic.RCS1241.severity = none # Implement IComparable when implementing IComparable<T><T>.
225
226dotnet_diagnostic.IDE0001.severity = none # Simplify name
227dotnet_diagnostic.IDE0002.severity = none # Simplify member access
228dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast
229dotnet_diagnostic.IDE0005.severity = none # Remove unnecessary cast
230dotnet_diagnostic.IDE0009.severity = none # Add this or Me qualification
231dotnet_diagnostic.IDE0017.severity = none # Object initializers
232dotnet_diagnostic.IDE0022.severity = none # Use block body for method
233dotnet_diagnostic.IDE0032.severity = none # Use auto property
234dotnet_diagnostic.IDE0035.severity = none # Remove unreachable code
235dotnet_diagnostic.IDE0040.severity = none # Add accessibility modifiers
236dotnet_diagnostic.IDE0044.severity = none # Make field readonly
237dotnet_diagnostic.IDE0051.severity = none # Remove unused private member
238dotnet_diagnostic.IDE0052.severity = none # Remove unread private member
239dotnet_diagnostic.IDE0058.severity = none # Remove unused expression value
240dotnet_diagnostic.IDE0059.severity = none # Unnecessary assignment of a value
241dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter
242dotnet_diagnostic.IDE0061.severity = none # Use expression body for local functions
243dotnet_diagnostic.IDE0078.severity = none # Use pattern matching
244dotnet_diagnostic.IDE0080.severity = none # Remove unnecessary suppression operator
245dotnet_diagnostic.IDE0090.severity = none # Simplify new expression
246dotnet_diagnostic.IDE0100.severity = none # Remove unnecessary equality operator
247dotnet_diagnostic.IDE0110.severity = none # Remove unnecessary discards
248dotnet_diagnostic.IDE00130.severity = none #
249dotnet_diagnostic.IDE0160.severity = none # Use block-scoped namespace
250
251###############################
252# Naming Conventions #
253###############################
254
255# Styles
256
257dotnet_naming_style.pascal_case_style.capitalization = pascal_case
258
259dotnet_naming_style.camel_case_style.capitalization = camel_case
260
261dotnet_naming_style.static_underscored.capitalization = camel_case
262dotnet_naming_style.static_underscored.required_prefix = s_
263
264dotnet_naming_style.underscored.capitalization = camel_case
265dotnet_naming_style.underscored.required_prefix = _
266
267dotnet_naming_style.uppercase_with_underscore_separator.capitalization = all_upper
268dotnet_naming_style.uppercase_with_underscore_separator.word_separator = _
269
270dotnet_naming_style.end_in_async.required_prefix =
271dotnet_naming_style.end_in_async.required_suffix = Async
272dotnet_naming_style.end_in_async.capitalization = pascal_case
273dotnet_naming_style.end_in_async.word_separator =
274
275# Symbols
276
277dotnet_naming_symbols.constant_fields.applicable_kinds = field
278dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
279dotnet_naming_symbols.constant_fields.required_modifiers = const
280
281dotnet_naming_symbols.local_constant.applicable_kinds = local
282dotnet_naming_symbols.local_constant.applicable_accessibilities = *
283dotnet_naming_symbols.local_constant.required_modifiers = const
284
285dotnet_naming_symbols.private_static_fields.applicable_kinds = field
286dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
287dotnet_naming_symbols.private_static_fields.required_modifiers = static
288
289dotnet_naming_symbols.private_fields.applicable_kinds = field
290dotnet_naming_symbols.private_fields.applicable_accessibilities = private
291
292dotnet_naming_symbols.any_async_methods.applicable_kinds = method
293dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
294dotnet_naming_symbols.any_async_methods.required_modifiers = async
295
296# Rules
297
298dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
299dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
300dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error
301
302dotnet_naming_rule.local_constant_should_be_pascal_case.symbols = local_constant
303dotnet_naming_rule.local_constant_should_be_pascal_case.style = pascal_case_style
304dotnet_naming_rule.local_constant_should_be_pascal_case.severity = error
305
306dotnet_naming_rule.private_static_fields_underscored.symbols = private_static_fields
307dotnet_naming_rule.private_static_fields_underscored.style = static_underscored
308dotnet_naming_rule.private_static_fields_underscored.severity = error
309
310dotnet_naming_rule.private_fields_underscored.symbols = private_fields
311dotnet_naming_rule.private_fields_underscored.style = underscored
312dotnet_naming_rule.private_fields_underscored.severity = error
313
314dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods
315dotnet_naming_rule.async_methods_end_in_async.style = end_in_async
316dotnet_naming_rule.async_methods_end_in_async.severity = error
317
318###############################
319# C# Coding Conventions #
320###############################
321
322# var preferences
323csharp_style_var_for_built_in_types = false:none
324csharp_style_var_when_type_is_apparent = false:none
325csharp_style_var_elsewhere = false:none
326# Expression-bodied members
327csharp_style_expression_bodied_methods = false:silent
328csharp_style_expression_bodied_constructors = false:silent
329csharp_style_expression_bodied_operators = false:silent
330csharp_style_expression_bodied_properties = true:silent
331csharp_style_expression_bodied_indexers = true:silent
332csharp_style_expression_bodied_accessors = true:silent
333# Pattern matching preferences
334csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
335csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
336# Null-checking preferences
337csharp_style_throw_expression = true:suggestion
338csharp_style_conditional_delegate_call = true:suggestion
339# Modifier preferences
340csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
341# Expression-level preferences
342csharp_prefer_braces = true:error
343csharp_style_deconstructed_variable_declaration = true:suggestion
344csharp_prefer_simple_default_expression = true:suggestion
345csharp_style_prefer_local_over_anonymous_function = true:error
346csharp_style_inlined_variable_declaration = true:suggestion
347
348###############################
349# C# Formatting Rules #
350###############################
351
352# New line preferences
353csharp_new_line_before_open_brace = all
354csharp_new_line_before_else = true
355csharp_new_line_before_catch = true
356csharp_new_line_before_finally = true
357csharp_new_line_before_members_in_object_initializers = false # Does not work with resharper, forcing code to be on long lines instead of wrapping
358csharp_new_line_before_members_in_anonymous_types = true
359csharp_new_line_between_query_expression_clauses = true
360# Indentation preferences
361csharp_indent_braces = false
362csharp_indent_case_contents = true
363csharp_indent_case_contents_when_block = false
364csharp_indent_switch_labels = true
365csharp_indent_labels = flush_left
366# Space preferences
367csharp_space_after_cast = false
368csharp_space_after_keywords_in_control_flow_statements = true
369csharp_space_between_method_call_parameter_list_parentheses = false
370csharp_space_between_method_declaration_parameter_list_parentheses = false
371csharp_space_between_parentheses = false
372csharp_space_before_colon_in_inheritance_clause = true
373csharp_space_after_colon_in_inheritance_clause = true
374csharp_space_around_binary_operators = before_and_after
375csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
376csharp_space_between_method_call_name_and_opening_parenthesis = false
377csharp_space_between_method_call_empty_parameter_list_parentheses = false
378# Wrapping preferences
379csharp_preserve_single_line_statements = true
380csharp_preserve_single_line_blocks = true
381csharp_using_directive_placement = outside_namespace:warning
382csharp_prefer_simple_using_statement = true:suggestion
383csharp_style_namespace_declarations = file_scoped:warning
384csharp_style_prefer_method_group_conversion = true:silent
385csharp_style_prefer_top_level_statements = true:silent
386csharp_style_expression_bodied_lambdas = true:silent
387csharp_style_expression_bodied_local_functions = false:silent
388
389