.editorconfig 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # EditorConfig is awesome:http://EditorConfig.org
  2. # From https://raw.githubusercontent.com/dotnet/roslyn/master/.editorconfig
  3. # top-most EditorConfig file
  4. root = true
  5. # Don't use tabs for indentation.
  6. [*]
  7. indent_style = space
  8. # (Please don't specify an indent_size here; that has too many unintended consequences.)
  9. # Code files
  10. [*.{cs,csx,vb,vbx}]
  11. indent_size = 4
  12. # Xml project files
  13. [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
  14. indent_size = 2
  15. # Xml config files
  16. [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
  17. indent_size = 2
  18. # JSON files
  19. [*.json]
  20. indent_size = 2
  21. # Dotnet code style settings:
  22. [*.{cs,vb}]
  23. # Sort using and Import directives with System.* appearing first
  24. dotnet_sort_system_directives_first = true
  25. # Avoid "this." and "Me." if not necessary
  26. dotnet_style_qualification_for_field = false:suggestion
  27. dotnet_style_qualification_for_property = false:suggestion
  28. dotnet_style_qualification_for_method = false:suggestion
  29. dotnet_style_qualification_for_event = false:suggestion
  30. # Use language keywords instead of framework type names for type references
  31. dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
  32. dotnet_style_predefined_type_for_member_access = true:suggestion
  33. # Suggest more modern language features when available
  34. dotnet_style_object_initializer = true:suggestion
  35. dotnet_style_collection_initializer = true:suggestion
  36. dotnet_style_coalesce_expression = true:suggestion
  37. dotnet_style_null_propagation = true:suggestion
  38. dotnet_style_explicit_tuple_names = true:suggestion
  39. # CSharp code style settings:
  40. [*.cs]
  41. # Prefer "var" everywhere
  42. csharp_style_var_for_built_in_types = true:suggestion
  43. csharp_style_var_when_type_is_apparent = true:suggestion
  44. csharp_style_var_elsewhere = true:suggestion
  45. # Prefer method-like constructs to have a block body
  46. csharp_style_expression_bodied_methods = false:none
  47. csharp_style_expression_bodied_constructors = false:none
  48. csharp_style_expression_bodied_operators = false:none
  49. # Prefer property-like constructs to have an expression-body
  50. csharp_style_expression_bodied_properties = true:none
  51. csharp_style_expression_bodied_indexers = true:none
  52. csharp_style_expression_bodied_accessors = true:none
  53. # Suggest more modern language features when available
  54. csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
  55. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  56. csharp_style_inlined_variable_declaration = true:suggestion
  57. csharp_style_throw_expression = true:suggestion
  58. csharp_style_conditional_delegate_call = true:suggestion
  59. # Newline settings
  60. csharp_new_line_before_open_brace = all
  61. csharp_new_line_before_else = true
  62. csharp_new_line_before_catch = true
  63. csharp_new_line_before_finally = true
  64. csharp_new_line_before_members_in_object_initializers = true
  65. csharp_new_line_before_members_in_anonymous_types = true