.editorconfig 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. insert_final_newline = true
  13. charset = utf-8-bom
  14. # Xml project files
  15. [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
  16. indent_size = 2
  17. # Xml config files
  18. [*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
  19. indent_size = 2
  20. # JSON files
  21. [*.json]
  22. indent_size = 2
  23. # Dotnet code style settings:
  24. [*.{cs,vb}]
  25. # Sort using and Import directives with System.* appearing first
  26. dotnet_sort_system_directives_first = true:suggestion
  27. # Avoid "this." and "Me." if not necessary
  28. dotnet_style_qualification_for_field = false:suggestion
  29. dotnet_style_qualification_for_property = false:suggestion
  30. dotnet_style_qualification_for_method = false:suggestion
  31. dotnet_style_qualification_for_event = false:suggestion
  32. # Use language keywords instead of framework type names for type references
  33. dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
  34. dotnet_style_predefined_type_for_member_access = true:suggestion
  35. # Suggest more modern language features when available
  36. dotnet_style_object_initializer = true:suggestion
  37. dotnet_style_collection_initializer = true:suggestion
  38. dotnet_style_coalesce_expression = true:suggestion
  39. dotnet_style_null_propagation = true:suggestion
  40. dotnet_style_explicit_tuple_names = true:suggestion
  41. dotnet_style_require_accessibility_modifiers = omit_if_default:suggestion
  42. # CSharp code style settings:
  43. [*.cs]
  44. # Prefer "var" everywhere
  45. csharp_style_var_for_built_in_types = true:suggestion
  46. csharp_style_var_when_type_is_apparent = true:suggestion
  47. csharp_style_var_elsewhere = true:suggestion
  48. # Prefer method-like constructs to have a block body
  49. csharp_style_expression_bodied_methods = false:none
  50. csharp_style_expression_bodied_constructors = false:none
  51. csharp_style_expression_bodied_operators = false:none
  52. # Prefer property-like constructs to have an expression-body
  53. csharp_style_expression_bodied_properties = true:none
  54. csharp_style_expression_bodied_indexers = true:none
  55. csharp_style_expression_bodied_accessors = true:none
  56. # Suggest more modern language features when available
  57. csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
  58. csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
  59. csharp_style_inlined_variable_declaration = true:suggestion
  60. csharp_style_throw_expression = true:suggestion
  61. csharp_style_conditional_delegate_call = true:suggestion
  62. # Newline settings
  63. csharp_new_line_before_open_brace = all
  64. csharp_new_line_before_else = true
  65. csharp_new_line_before_catch = true
  66. csharp_new_line_before_finally = true
  67. csharp_new_line_before_members_in_object_initializers = true
  68. csharp_new_line_before_members_in_anonymous_types = true