|
| 1 | +There are 3 sections of editorconfig configuration options: Formatting, Code Style, and Naming. For the most part the Formatting options are covered by the Roslyn Formatter, which leaves the Code Style and Naming options to be implemented. Below is a list of Code Style options. Naming options will be handled separately. |
| 2 | + |
| 3 | +# .NET code style settings |
| 4 | + |
| 5 | +## "This." and "Me." qualifiers |
| 6 | +Name | Base Class | Option | Diagnostic |
| 7 | +-|-|-|- |
| 8 | +dotnet_style_qualification_for_field | AbstractQualifyMemberAccessDiagnosticAnalyzer | CodeStyleOptions.QualifyFieldAccess | AddQualificationDiagnosticId = "IDE0009" |
| 9 | +dotnet_style_qualification_for_property | AbstractQualifyMemberAccessDiagnosticAnalyzer | CodeStyleOptions.QualifyPropertyAccess | AddQualificationDiagnosticId = "IDE0009" |
| 10 | +dotnet_style_qualification_for_method | AbstractQualifyMemberAccessDiagnosticAnalyzer | CodeStyleOptions.QualifyMethodAccess | AddQualificationDiagnosticId = "IDE0009" |
| 11 | +dotnet_style_qualification_for_event | AbstractQualifyMemberAccessDiagnosticAnalyzer | CodeStyleOptions.QualifyEventAccess | AddQualificationDiagnosticId = "IDE0009" |
| 12 | + |
| 13 | +## Language keywords instead of framework type names for type references |
| 14 | +Name | Base Class | Option | Diagnostic |
| 15 | +-|-|-|- |
| 16 | +dotnet_style_predefined_type_for_locals_parameters_members | PreferFrameworkTypeDiagnosticAnalyzerBase | CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInDeclaration | PreferBuiltInOrFrameworkTypeDiagnosticId = "IDE0049" |
| 17 | +dotnet_style_predefined_type_for_member_access | PreferFrameworkTypeDiagnosticAnalyzerBase | CodeStyleOptions.PreferIntrinsicPredefinedTypeKeywordInMemberAccess | PreferBuiltInOrFrameworkTypeDiagnosticId = "IDE0049" |
| 18 | + |
| 19 | +## Modifier preferences |
| 20 | +Name | Base Class | Option | Diagnostic |
| 21 | +-|-|-|- |
| 22 | +dotnet_style_require_accessibility_modifiers | AbstractAddAccessibilityModifiersDiagnosticAnalyzer | CodeStyleOptions.RequireAccessibilityModifiers | AddAccessibilityModifiersDiagnosticId = "IDE0040" |
| 23 | +csharp_preferred_modifier_order | AbstractOrderModifiersDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferredModifierOrder | OrderModifiersDiagnosticId = "IDE0036" |
| 24 | +visual_basic_preferred_modifier_order | AbstractOrderModifiersDiagnosticAnalyzer | VisualBasicCodeStyleOptions.PreferredModifierOrder | OrderModifiersDiagnosticId = "IDE0036" |
| 25 | +dotnet_style_readonly_field | MakeFieldReadonlyDiagnosticAnalyzer | CodeStyleOption.PreferReadonly | MakeFieldReadonlyDiagnosticId = "IDE0044" |
| 26 | + |
| 27 | +## Parentheses preferences |
| 28 | +Name | Base Class | Option | Diagnostic |
| 29 | +-|-|-|- |
| 30 | +dotnet_style_parentheses_in_arithmetic_binary_operators | AbstractAddRequiredParenthesesDiagnosticAnalyzer<br>AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer | CodeStyleOption.ArithmeticBinaryParentheses | AddRequiredParenthesesDiagnosticId = "IDE0048"<br>RemoveUnnecessaryParenthesesDiagnosticId = "IDE0047" |
| 31 | +dotnet_style_parentheses_in_other_binary_operators | AbstractAddRequiredParenthesesDiagnosticAnalyzer<br>AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer | CodeStyleOptions.OtherBinaryParentheses | AddRequiredParenthesesDiagnosticId = "IDE0048"<br>RemoveUnnecessaryParenthesesDiagnosticId = "IDE0047" |
| 32 | +dotnet_style_parentheses_in_other_operators | AbstractAddRequiredParenthesesDiagnosticAnalyzer<br>AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer | CodeStyleOptions.OtherParentheses | AddRequiredParenthesesDiagnosticId = "IDE0048"<br>RemoveUnnecessaryParenthesesDiagnosticId = "IDE0047" |
| 33 | +dotnet_style_parentheses_in_relational_binary_operators | AbstractAddRequiredParenthesesDiagnosticAnalyzer<br>AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer | CodeStyleOptions.RelationalBinaryParentheses | AddRequiredParenthesesDiagnosticId = "IDE0048"<br>RemoveUnnecessaryParenthesesDiagnosticId = "IDE0047" |
| 34 | + |
| 35 | +## Expression-level preferences |
| 36 | +Name | Base Class | Option | Diagnostic |
| 37 | +-|-|-|- |
| 38 | +dotnet_style_object_initializer | AbstractUseObjectInitializerDiagnosticAnalyzer | CodeStyleOptions.PreferObjectInitializer | UseObjectInitializerDiagnosticId = "IDE0017" |
| 39 | +dotnet_style_collection_initializer | AbstractUseCollectionInitializerDiagnosticAnalyzer | CodeStyleOptions.PreferCollectionInitializer | UseCollectionInitializerDiagnosticId = "IDE0028" |
| 40 | +dotnet_style_explicit_tuple_names | UseExplicitTupleNameDiagnosticAnalyzer | CodeStyleOptions.PreferExplicitTupleNames | UseExplicitTupleNameDiagnosticId = "IDE0033" |
| 41 | +dotnet_style_prefer_inferred_tuple_names | AbstractUseInferredMemberNameDiagnosticAnalyzer | CodeStyleOptions.PreferInferredTupleNames | UseInferredMemberNameDiagnosticId = "IDE0037" |
| 42 | +dotnet_style_prefer_inferred_anonymous_type_member_names | AbstractUseInferredMemberNameDiagnosticAnalyzer | CodeStyleOptions.PreferInferredAnonymousTypeMemberNames | UseInferredMemberNameDiagnosticId = "IDE0037" |
| 43 | +dotnet_style_prefer_auto_properties | AbstractUseAutoPropertyAnalyzer | CodeStyleOptions.PreferAutoProperties | UseAutoPropertyDiagnosticId = "IDE0032" |
| 44 | +dotnet_style_prefer_is_null_check_over_reference_equality_method | AbstractUseIsNullCheckForReferenceEqualsDiagnosticAnalyzer | CodeStyleOptions.PreferIsNullCheckOverReferenceEqualityMethod | UseIsNullCheckDiagnosticId = "IDE0041" |
| 45 | +dotnet_style_prefer_conditional_expression_over_assignment | AbstractUseConditionalExpressionForAssignmentDiagnosticAnalyzer | CodeStyleOptions.PreferConditionalExpressionOverAssignment | UseConditionalExpressionForAssignmentDiagnosticId = "IDE0045" |
| 46 | +dotnet_style_prefer_conditional_expression_over_return | AbstractUseConditionalExpressionForReturnDiagnosticAnalyzer | CodeStyleOptions.PreferConditionalExpressionOverReturn | UseConditionalExpressionForReturnDiagnosticId = "IDE0046" |
| 47 | +dotnet_style_prefer_compound_assignment | AbstractUseCompoundAssignmentDiagnosticAnalyzer | CodeStyleOptions.PreferCompoundAssignment | UseCompoundAssignmentDiagnosticId = "IDE0054" |
| 48 | + |
| 49 | +## "Null" checking preferences |
| 50 | +Name | Base Class | Option | Diagnostic |
| 51 | +-|-|-|- |
| 52 | +dotnet_style_coalesce_expression | AbstractUseCoalesceExpressionDiagnosticAnalyzer | CodeStyleOptions.PreferCoalesceExpression | UseCoalesceExpressionDiagnosticId = "IDE0029" |
| 53 | +dotnet_style_null_propagation | AbstractUseNullPropagationDiagnosticAnalyzer | CodeStyleOptions.PreferNullPropagation | UseNullPropagationDiagnosticId = "IDE0031" |
| 54 | + |
| 55 | +# C# code style settings |
| 56 | + |
| 57 | +## Implicit and explicit types |
| 58 | +Name | Base Class | Option | Diagnostic |
| 59 | +-|-|-|- |
| 60 | +csharp_style_var_for_built_in_types | CSharpUseExplicitTypeDiagnosticAnalyzer<br>CSharpUseImplicitTypeDiagnosticAnalyzer | CSharpCodeStyleOptions.VarForBuiltInTypes | UseExplicitTypeDiagnosticId = "IDE0008"<br>UseImplicitTypeDiagnosticId = "IDE0007" |
| 61 | +csharp_style_var_when_type_is_apparent | CSharpUseExplicitTypeDiagnosticAnalyzer<br>CSharpUseImplicitTypeDiagnosticAnalyzer | CSharpCodeStyleOptions.VarWhenTypeIsApparent | UseExplicitTypeDiagnosticId = "IDE0008"<br>UseImplicitTypeDiagnosticId = "IDE0007" |
| 62 | +csharp_style_var_elsewhere | CSharpUseExplicitTypeDiagnosticAnalyzer<br>CSharpUseImplicitTypeDiagnosticAnalyzer | CSharpCodeStyleOptions.VarElsewhere | UseExplicitTypeDiagnosticId = "IDE0008"<br>UseImplicitTypeDiagnosticId = "IDE0007" |
| 63 | + |
| 64 | +## Expression-bodied members |
| 65 | +Name | Base Class | Option | Diagnostic |
| 66 | +-|-|-|- |
| 67 | +csharp_style_expression_bodied_methods | UseExpressionBodyForMethodsHelper | CSharpCodeStyleOptions.PreferExpressionBodiedMethods | UseExpressionBodyForMethodsDiagnosticId = "IDE0022" |
| 68 | +csharp_style_expression_bodied_constructors | UseExpressionBodyForConstructorsHelper | CSharpCodeStyleOptions.PreferExpressionBodiedConstructors | UseExpressionBodyForConstructorsDiagnosticId = "IDE0021" |
| 69 | +csharp_style_expression_bodied_operators | UseExpressionBodyForOperatorsHelper | CSharpCodeStyleOptions.PreferExpressionBodiedOperators | UseExpressionBodyForOperatorsDiagnosticId = "IDE0024" |
| 70 | +csharp_style_expression_bodied_properties | UseExpressionBodyForPropertiesHelper | CSharpCodeStyleOptions.PreferExpressionBodiedProperties | UseExpressionBodyForPropertiesDiagnosticId = "IDE0025" |
| 71 | +csharp_style_expression_bodied_indexers | UseExpressionBodyForIndexersHelper | CSharpCodeStyleOptions.PreferExpressionBodiedIndexers | UseExpressionBodyForIndexersDiagnosticId = "IDE0026" |
| 72 | +csharp_style_expression_bodied_accessors | UseExpressionBodyForAccessorsHelper | CSharpCodeStyleOptions.PreferExpressionBodiedAccessors | UseExpressionBodyForAccessorsDiagnosticId = "IDE0027" |
| 73 | +csharp_style_expression_bodied_lambdas | UseExpressionBodyForLambdaDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferExpressionBodiedLambdas | UseExpressionBodyForLambdaExpressionsDiagnosticId = "IDE0053" |
| 74 | +csharp_style_expression_bodied_local_functions | UseExpressionBodyForLocalFunctionHelper | CSharpCodeStyleOptions.PreferExpressionBodiedLocalFunctions | UseExpressionBodyForLocalFunctionsDiagnosticId = "IDE0061" |
| 75 | + |
| 76 | +## Pattern matching |
| 77 | +Name | Base Class | Option | Diagnostic |
| 78 | +-|-|-|- |
| 79 | +csharp_style_pattern_matching_over_is_with_cast_check | CSharpIsAndCastCheckDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferPatternMatchingOverIsWithCastCheck | InlineIsTypeCheckId = "IDE0020" |
| 80 | +csharp_style_pattern_matching_over_as_with_null_check | CSharpAsAndNullCheckDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferPatternMatchingOverAsWithNullCheck | InlineAsTypeCheckId = "IDE0019" |
| 81 | +csharp_style_prefer_switch_expression | ConvertSwitchStatementToExpressionDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferSwitchExpression | ConvertSwitchStatementToExpressionDiagnosticId = "IDE0066" |
| 82 | + |
| 83 | +## Inlined variable declarations |
| 84 | +Name | Base Class | Option | Diagnostic |
| 85 | +-|-|-|- |
| 86 | +csharp_style_inlined_variable_declaration | CSharpInlineDeclarationDiagnosticAnalyzer | CodeStyleOptions.PreferInlinedVariableDeclaration | InlineDeclarationDiagnosticId = "IDE0018" |
| 87 | + |
| 88 | +## Expression-level preferences |
| 89 | +Name | Base Class | Option | Diagnostic |
| 90 | +-|-|-|- |
| 91 | +csharp_prefer_simple_default_expression | CSharpUseDefaultLiteralDiagnosticAnalyzer | CSharpCodeStyleOptions.UseDefaultLiteralDiagnosticId | UseDefaultLiteralDiagnosticId = "IDE0034" |
| 92 | +csharp_style_deconstructed_variable_declaration | CSharpUseDeconstructionDiagnosticAnalyzer | CodeStyleOptions.PreferDeconstructedVariableDeclaration | UseDeconstructionDiagnosticId = "IDE0042" |
| 93 | +csharp_style_pattern_local_over_anonymous_function | CSharpUseLocalFunctionDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferLocalOverAnonymousFunction | UseLocalFunctionDiagnosticId = "IDE0039" |
| 94 | +csharp_style_prefer_index_operator | CSharpUseIndexOperatorDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferIndexOperator | UseIndexOperatorDiagnosticId = "IDE0056" |
| 95 | +csharp_style_prefer_range_operator | CSharpUseRangeOperatorDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferRangeOperator | UseRangeOperatorDiagnosticId = "IDE0057" |
| 96 | +csharp_prefer_static_local_function | MakeLocalFunctionStaticDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferStaticLocalFunction | MakeLocalFunctionStaticDiagnosticId = "IDE0062" |
| 97 | +csharp_prefer_simple_using_statement | UseSimpleUsingStatementDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferSimpleUsingStatement | UseSimpleUsingStatementDiagnosticId = "IDE0063" |
| 98 | + |
| 99 | +## "Null" checking preferences |
| 100 | +Name | Base Class | Option | Diagnostic |
| 101 | +-|-|-|- |
| 102 | +csharp_style_throw_expression | AbstractUseThrowExpressionDiagnosticAnalyzer | CodeStyleOptions.PreferThrowExpression | UseThrowExpressionDiagnosticId = "IDE0016" |
| 103 | +csharp_style_conditional_delegate_call | InvokeDelegateWithConditionalAccessAnalyzer | CSharpCodeStyleOptions.PreferConditionalDelegateCall | InvokeDelegateWithConditionalAccessId = "IDE1005" |
| 104 | + |
| 105 | +## Code block preferences |
| 106 | +Name | Base Class | Option | Diagnostic |
| 107 | +-|-|-|- |
| 108 | +csharp_prefer_braces | CSharpAddBracesDiagnosticAnalyzer | CSharpCodeStyleOptions.PreferBraces | AddBracesDiagnosticId = "IDE0011" |
0 commit comments