Skip to content

Dominik-Wesolowski/editorconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

root = true

[*] charset = utf-8 end_of_line = lf indent_style = space insert_final_newline = true trim_trailing_whitespace = true

[*.cs] indent_size = 4 tab_width = 4

###############

Basic layout

###############

dotnet_sort_system_directives_first = true csharp_using_directive_placement = outside_namespace:suggestion csharp_style_namespace_declarations = file_scoped:suggestion

###############

Readability

###############

csharp_prefer_braces = true:warning csharp_preserve_single_line_blocks = true csharp_preserve_single_line_statements = false

dotnet_style_qualification_for_field = false:suggestion dotnet_style_qualification_for_property = false:suggestion dotnet_style_qualification_for_method = false:suggestion dotnet_style_qualification_for_event = false:suggestion

dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion dotnet_style_predefined_type_for_member_access = true:suggestion

###############

var policy

Use var only when the type is obvious

###############

csharp_style_var_for_built_in_types = false:suggestion csharp_style_var_when_type_is_apparent = true:suggestion csharp_style_var_elsewhere = false:suggestion

###############

Expression / syntax preferences

###############

dotnet_style_object_initializer = true:suggestion dotnet_style_collection_initializer = true:suggestion dotnet_style_coalesce_expression = true:suggestion dotnet_style_null_propagation = true:suggestion dotnet_style_operator_placement_when_wrapping = beginning_of_line

csharp_style_prefer_switch_expression = true:suggestion csharp_style_prefer_pattern_matching = true:suggestion csharp_style_inlined_variable_declaration = true:suggestion csharp_prefer_simple_using_statement = true:suggestion csharp_prefer_simple_default_expression = true:suggestion

###############

Performance / maintainability

###############

dotnet_style_readonly_field = true:warning csharp_prefer_static_local_function = true:suggestion

###############

Naming

###############

const -> PascalCase

dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = warning dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.constant_fields.applicable_kinds = field dotnet_naming_symbols.constant_fields.required_modifiers = const

private/internal static fields -> s_camelCase

dotnet_naming_rule.static_fields_should_have_prefix.severity = warning dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style

dotnet_naming_symbols.static_fields.applicable_kinds = field dotnet_naming_symbols.static_fields.required_modifiers = static dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected

dotnet_naming_style.static_prefix_style.required_prefix = s_ dotnet_naming_style.static_prefix_style.capitalization = camel_case

private/internal instance fields -> _camelCase

dotnet_naming_rule.private_internal_fields_should_be_underscore_camel_case.severity = warning dotnet_naming_rule.private_internal_fields_should_be_underscore_camel_case.symbols = private_internal_instance_fields dotnet_naming_rule.private_internal_fields_should_be_underscore_camel_case.style = underscore_camel_case_style

dotnet_naming_symbols.private_internal_instance_fields.applicable_kinds = field dotnet_naming_symbols.private_internal_instance_fields.applicable_accessibilities = private, internal, private_protected dotnet_naming_symbols.private_internal_instance_fields.required_modifiers =

dotnet_naming_style.underscore_camel_case_style.required_prefix = _ dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case

async methods -> Async suffix

dotnet_naming_rule.async_methods_should_have_async_suffix.severity = warning dotnet_naming_rule.async_methods_should_have_async_suffix.symbols = async_methods dotnet_naming_rule.async_methods_should_have_async_suffix.style = async_suffix_style

dotnet_naming_symbols.async_methods.applicable_kinds = method dotnet_naming_symbols.async_methods.required_modifiers = async

dotnet_naming_style.async_suffix_style.required_suffix = Async dotnet_naming_style.async_suffix_style.capitalization = pascal_case

dotnet_naming_style.pascal_case_style.capitalization = pascal_case

###############

Diagnostics worth enforcing

###############

formatting

dotnet_diagnostic.IDE0055.severity = warning

remove unused usings

dotnet_diagnostic.IDE0005.severity = warning

add braces

dotnet_diagnostic.IDE0011.severity = warning

order modifiers

dotnet_diagnostic.IDE0036.severity = suggestion

make field readonly

dotnet_diagnostic.IDE0044.severity = warning

remove unnecessary assignment

dotnet_diagnostic.IDE0059.severity = warning

remove unused private members

dotnet_diagnostic.IDE0051.severity = suggestion

remove unused parameters only for non-public members

dotnet_code_quality_unused_parameters = non_public dotnet_diagnostic.IDE0060.severity = warning

make local function static

dotnet_diagnostic.IDE0062.severity = suggestion

file-scoped namespace

dotnet_diagnostic.IDE0161.severity = suggestion

###############

Code quality analyzers

###############

forward CancellationToken when possible

dotnet_diagnostic.CA2016.severity = warning

mark members static when possible

dotnet_diagnostic.CA1822.severity = suggestion

specify IFormatProvider where it matters - useful, but can be noisy

dotnet_diagnostic.CA1305.severity = suggestion

prefer generated Regex for static patterns

dotnet_diagnostic.SYSLIB1045.severity = suggestion

###############

Intentionally relaxed

###############

too noisy for app/backend codebases

dotnet_diagnostic.CA2007.severity = none dotnet_diagnostic.CA1062.severity = none dotnet_diagnostic.CA1716.severity = none

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors