Skip to content

Commit b3d1545

Browse files
authored
Update editorconfig with naming rules (#50854)
1 parent 82efb43 commit b3d1545

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,23 @@ csharp_style_namespace_declarations = file_scoped
5555
# Brace settings
5656
csharp_prefer_braces = true # Prefer curly braces even for one line of code
5757

58+
# name all constant fields using PascalCase
59+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
60+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
61+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
62+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
63+
dotnet_naming_symbols.constant_fields.required_modifiers = const
64+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
65+
66+
# internal and private fields should be _camelCase
67+
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
68+
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
69+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
70+
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
71+
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
72+
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
73+
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
74+
5875
[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}]
5976
indent_size = 2
6077

0 commit comments

Comments
 (0)