.editorconfig 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # EditorConfig: https://editorconfig.org/
  2. # Format details: https://editorconfig.org/#file-format-details
  3. # This file is the top-most EditorConfig file
  4. root = true
  5. # All files
  6. [*]
  7. charset = utf-8
  8. end_of_line = lf
  9. indent_style = tab
  10. insert_final_newline = true
  11. trim_trailing_whitespace = true
  12. ##########################################
  13. # File Extension Settings
  14. ##########################################
  15. # Make files
  16. [Makefile]
  17. indent_style = tab
  18. #Markdown
  19. [*.mk]
  20. indent_style = tab
  21. # Visual Studio Solution Files
  22. [*.sln]
  23. indent_style = tab
  24. # Code files
  25. [*.{cs,html,js,css}]
  26. insert_final_newline = true
  27. indent_style = tab
  28. ##########################################
  29. # .NET Language Conventions
  30. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference#language-conventions
  31. ##########################################
  32. # .NET Code Style Settings
  33. [*.{cs,csx,cake,vb}]
  34. # "this." and "Me." qualifiers
  35. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#this-and-me
  36. dotnet_style_qualification_for_field = false:none
  37. dotnet_style_qualification_for_property = false:none
  38. dotnet_style_qualification_for_method = false:none
  39. dotnet_style_qualification_for_event = false:none
  40. # Language keywords instead of framework type names for type references
  41. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#language-keywords
  42. dotnet_style_predefined_type_for_locals_parameters_members = true:warning
  43. dotnet_style_predefined_type_for_member_access = true:warning
  44. # Modifier preferences
  45. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#normalize-modifiers
  46. dotnet_style_require_accessibility_modifiers = never:suggestion
  47. csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
  48. dotnet_style_readonly_field = false:none
  49. # Parentheses preferences
  50. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#parentheses-preferences
  51. dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:suggestion
  52. dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion
  53. dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:suggestion
  54. dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
  55. # Expression-level preferences
  56. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#expression-level-preferences
  57. dotnet_style_object_initializer = false:none
  58. dotnet_style_collection_initializer = false:none
  59. dotnet_style_explicit_tuple_names = true:warning
  60. dotnet_style_prefer_inferred_tuple_names = false:none
  61. dotnet_style_prefer_inferred_anonymous_type_member_names = false:none
  62. dotnet_style_prefer_auto_properties = false:none
  63. dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
  64. dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
  65. dotnet_style_prefer_conditional_expression_over_return = true:suggestion
  66. # Null-checking preferences
  67. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#null-checking-preferences
  68. dotnet_style_coalesce_expression = true:warning
  69. dotnet_style_null_propagation = true:warning
  70. # C# Code Style Settings
  71. [*.{cs,csx,cake}]
  72. # Implicit and explicit types
  73. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#implicit-and-explicit-types
  74. csharp_style_var_for_built_in_types = true:warning
  75. csharp_style_var_when_type_is_apparent = true:warning
  76. csharp_style_var_elsewhere = true:warning
  77. # Expression-bodied members
  78. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#expression-bodied-members
  79. csharp_style_expression_bodied_methods = true:suggestion
  80. csharp_style_expression_bodied_constructors = true:suggestion
  81. csharp_style_expression_bodied_operators = true:suggestion
  82. csharp_style_expression_bodied_properties = true:suggestion
  83. csharp_style_expression_bodied_indexers = true:suggestion
  84. csharp_style_expression_bodied_accessors = true:suggestion
  85. # Pattern matching
  86. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#pattern-matching
  87. csharp_style_pattern_matching_over_is_with_cast_check = false:suggestion
  88. csharp_style_pattern_matching_over_as_with_null_check = false:suggestion
  89. # Inlined variable declarations
  90. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#inlined-variable-declarations
  91. csharp_style_inlined_variable_declaration = true:suggestion
  92. # Expression-level preferences
  93. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#expression-level-preferences-1
  94. csharp_prefer_simple_default_expression = false:suggestion
  95. csharp_style_deconstructed_variable_declaration = false:suggestion
  96. csharp_style_pattern_local_over_anonymous_function = false:suggestion
  97. # "Null" checking preferences
  98. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#null-checking-preferences-1
  99. csharp_style_throw_expression = true:suggestion
  100. csharp_style_conditional_delegate_call = true:suggestion
  101. # Code block preferences
  102. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-language-conventions?view=vs-2019#code-block-preferences
  103. csharp_prefer_braces = false:suggestion
  104. ##########################################
  105. # .NET Formatting Conventions
  106. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-formatting-conventions?view=vs-2019
  107. [*.{cs}]
  108. # Organizing Imports
  109. # https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-formatting-conventions?view=vs-2019#organize-using-directives
  110. dotnet_sort_system_directives_first = true
  111. dotnet_separate_import_directive_groups = true