Links
Those rules are enabled by default.
Edit the project file to enable additional rules:
MyProject.csproj
|
<PropertyGroup>
<AnalysisLevel>latest-recommended</AnalysisLevel>
</PropertyGroup>
|
Editorconfig
Core options
.editorconfig
|
root = true
[*]
indent_style = space
insert_final_newline = true
charset = utf-8
[*.csproj]
indent_size = 2
[*.json]
indent_size = 2
[*.cs]
indent_size = 4
trim_trailing_whitespace = true
dotnet_analyzer_diagnostic.severity = warning
|
Style configuration
.editorconfig
|
csharp_style_namespace_declarations = file_scoped : error
csharp_style_var_for_built_in_types = true
csharp_style_var_when_type_is_apparent = true
csharp_style_var_elsewhere = false : suggestion
|
Disable rules
.editorconfig
|
dotnet_diagnostic.VSSpell001.severity = suggestion
dotnet_diagnostic.VSSpell002.severity = suggestion
dotnet_diagnostic.CA1304.severity = suggestion
dotnet_diagnostic.CA1311.severity = suggestion
|