I have a single .editorconfig file in a root directory that applies to all of my Visual Studio projects. It contains the following rules:
# Const field naming rules
dotnet_naming_symbols.const_fields.applicable_accessibilities = *
dotnet_naming_symbols.const_fields.required_modifiers = const
dotnet_naming_rule.const_fields.symbols = const_fields
dotnet_naming_rule.const_fields.style = all_upper
dotnet_naming_rule.const_fields.severity = warning
# Enum naming rules
dotnet_naming_symbols.enums.applicable_kinds = enum
dotnet_naming_rule.enums.symbols = enums
dotnet_naming_rule.enums.style = pascal_case
dotnet_naming_rule.enums.severity = warning
# Naming Styles
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.all_upper.capitalization = all_upper
According to the EditorConfig docs
EditorConfig files are read top to bottom and the closest EditorConfig files are read last. Properties from matching EditorConfig sections are applied in the order they were read, so properties in closer files take precedence.
By that reasoning, my enums rules should "take precedence" over my const_fields rules. However, the following enum declaration continues to give me a warning:
public enum AggregationMode {
Simultaneous,
Sequential,
}
Saying: Warning IDE1006 Naming rule violation: These words cannot contain lower case characters.
Are enum values treated as const by the compiler? I have tried closing/reopening my code file in VS, reordering the const/enum sections of the .editorconfig, building/rebuilding my solution, and even restarting VS, but the warning won't go away. Any suggestions would be much appreciated!