|
| 1 | +# EditorConfig for Streamer.bot Giveaway Helper |
| 2 | +# Purpose: Suppress C# 8.0+/.NET Core features NOT available in C# 7.3/.NET Framework 4.8 |
| 3 | +# |
| 4 | +# IMPORTANT: After editing this file, you may need to: |
| 5 | +# 1. Close and reopen the solution in Visual Studio, OR |
| 6 | +# 2. Right-click solution → Reload Solution, OR |
| 7 | +# 3. Restart your IDE |
| 8 | +# |
| 9 | +# Documentation: https://editorconfig.org/ |
| 10 | +# IDE Codes: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ |
| 11 | + |
| 12 | +root = true |
| 13 | + |
| 14 | +[*.cs] |
| 15 | +charset = utf-8 |
| 16 | +end_of_line = crlf |
| 17 | +trim_trailing_whitespace = true |
| 18 | + |
| 19 | +# = ================================================================== |
| 20 | +# PERFORMANCE & LEGACY COMPATIBILITY - SUPPRESS |
| 21 | +# =================================================================== |
| 22 | + |
| 23 | +# .NET Core 2.0+ String Method Overloads (not in .NET Framework 4.8) |
| 24 | +dotnet_diagnostic.IDE0057.severity = none # string.Contains(char) |
| 25 | +dotnet_diagnostic.IDE0058.severity = none # string.StartsWith(char) |
| 26 | +dotnet_diagnostic.CA1865.severity = none # Use 'string.StartsWith(char)' |
| 27 | +dotnet_diagnostic.CA1866.severity = none # Use 'string.StartsWith(char)' |
| 28 | +dotnet_diagnostic.CA1867.severity = none # Use 'string.Contains(char)' |
| 29 | + |
| 30 | +# Performance suggestions that might be overkill or incompatible |
| 31 | +dotnet_diagnostic.CA1822.severity = none # Mark members as static |
| 32 | +dotnet_diagnostic.CA1850.severity = none # Prefer static HashData method (not in .NET Framework 4.8)\r |
| 33 | +dotnet_diagnostic.CA1510.severity = none # Use ArgumentNullException.ThrowIfNull (not in .NET Framework 4.8) |
| 34 | +dotnet_diagnostic.CA1861.severity = none # Prefer 'static readonly' fields over constant array arguments |
| 35 | + |
| 36 | +# =================================================================== |
| 37 | +# MODERN C# FEATURES - MUST SUPPRESS (Not in C# 7.3) |
| 38 | +# =================================================================== |
| 39 | + |
| 40 | +# C# 9.0+ Target-Typed New Expressions |
| 41 | +dotnet_diagnostic.IDE0090.severity = none # Use 'new(...)' |
| 42 | +csharp_style_implicit_object_creation_when_type_is_apparent = false |
| 43 | + |
| 44 | +# C# 7.3 / .NET Framework 4.8 Compatibility Suppressions |
| 45 | + |
| 46 | +# C# 8.0+ Null-Coalescing Assignment (??=) |
| 47 | +dotnet_diagnostic.IDE0074.severity = none |
| 48 | +csharp_style_prefer_null_coalescing_assignment = false |
| 49 | + |
| 50 | +# Collection expressions (C# 12.0+) and simplified initialization |
| 51 | +dotnet_diagnostic.IDE0028.severity = none |
| 52 | +dotnet_diagnostic.IDE0300.severity = none |
| 53 | +dotnet_diagnostic.IDE0301.severity = none |
| 54 | +dotnet_diagnostic.IDE0305.severity = none |
| 55 | +csharp_style_prefer_collection_expression = false |
| 56 | + |
| 57 | +# string.Contains(char) overload (not available in .NET Framework 4.8) |
| 58 | +dotnet_diagnostic.CA1847.severity = none |
| 59 | + |
| 60 | +# string.Contains(string, StringComparison) overload (not available in .NET Framework 4.8) |
| 61 | +dotnet_diagnostic.CA1862.severity = none |
| 62 | + |
| 63 | +# Prefer readonly fields (informational only - can be implemented but noisy) |
| 64 | +dotnet_diagnostic.IDE0044.severity = none |
| 65 | + |
| 66 | +# C# 8.0+ Using Declarations |
| 67 | +dotnet_diagnostic.IDE0063.severity = none # Use simple 'using' statement |
| 68 | +csharp_prefer_simple_using_statement = false |
| 69 | + |
| 70 | +# C# 12.0+ Primary Constructors |
| 71 | +dotnet_diagnostic.IDE0290.severity = none # Use primary constructor |
| 72 | + |
| 73 | +# C# 12.0+ Collection Expressions |
| 74 | +dotnet_diagnostic.IDE0300.severity = none # Collection initialization can be simplified |
| 75 | +dotnet_diagnostic.IDE0301.severity = none # Use collection expression |
| 76 | + |
| 77 | +# C# 11.0+ Regex Generator |
| 78 | +dotnet_diagnostic.SYSLIB1045.severity = none # Use 'GeneratedRegexAttribute' |
| 79 | + |
| 80 | +# =================================================================== |
| 81 | +# STYLE PREFERENCES - SUPPRESS (Reduce Visual Noise) |
| 82 | +# =================================================================== |
| 83 | + |
| 84 | +# --- Variable Type Declarations (var vs explicit) --- |
| 85 | +dotnet_diagnostic.IDE0007.severity = none # Use explicit type instead of 'var' |
| 86 | +dotnet_diagnostic.IDE0008.severity = none # Use var instead of explicit type |
| 87 | +csharp_style_var_when_type_is_apparent = false:none |
| 88 | +csharp_style_var_for_built_in_types = false:none |
| 89 | +csharp_style_var_elsewhere = false:none |
| 90 | + |
| 91 | +# --- Braces on Single-Line Statements --- |
| 92 | +dotnet_diagnostic.IDE0011.severity = none # Add braces |
| 93 | +csharp_prefer_braces = when_multiline:none |
| 94 | + |
| 95 | +# --- Expression Bodies vs Block Bodies --- |
| 96 | +dotnet_diagnostic.IDE0021.severity = none # Use expression body for constructors |
| 97 | +dotnet_diagnostic.IDE0022.severity = none # Use expression body for methods |
| 98 | +dotnet_diagnostic.IDE0023.severity = none # Use expression body for operators |
| 99 | +dotnet_diagnostic.IDE0024.severity = none # Use expression body for operators |
| 100 | +dotnet_diagnostic.IDE0025.severity = none # Use expression body for properties |
| 101 | +dotnet_diagnostic.IDE0026.severity = none # Use expression body for indexers |
| 102 | +dotnet_diagnostic.IDE0027.severity = none # Use expression body for accessors |
| 103 | +dotnet_diagnostic.IDE0053.severity = none # Use block body for lambda expressions |
| 104 | +dotnet_diagnostic.IDE0061.severity = none # Use block body for local functions |
| 105 | + |
| 106 | +# --- Code Simplifications --- |
| 107 | +dotnet_diagnostic.IDE0001.severity = none # Simplify name |
| 108 | +dotnet_diagnostic.IDE0002.severity = none # Simplify member access |
| 109 | +dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast |
| 110 | +dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch |
| 111 | +dotnet_diagnostic.IDE0017.severity = none # Simplify object initialization |
| 112 | +dotnet_diagnostic.IDE0018.severity = none # Variable declaration can be inlined |
| 113 | +dotnet_diagnostic.IDE0028.severity = none # Collection initialization can be simplified |
| 114 | +dotnet_diagnostic.IDE0032.severity = none # Use auto property |
| 115 | +dotnet_diagnostic.IDE0034.severity = none # Simplify 'default' expression |
| 116 | +dotnet_diagnostic.IDE0035.severity = none # Remove unreachable code |
| 117 | +dotnet_diagnostic.IDE0042.severity = none # Deconstruct variable declaration |
| 118 | +dotnet_diagnostic.IDE0051.severity = none # Remove unused private member |
| 119 | +dotnet_diagnostic.IDE0052.severity = none # Remove unread private member |
| 120 | +dotnet_diagnostic.IDE0055.severity = none # Fix formatting |
| 121 | +dotnet_diagnostic.IDE0059.severity = none # Unnecessary assignment of a value |
| 122 | +dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter |
| 123 | +dotnet_diagnostic.IDE0071.severity = none # Simplify interpolation |
| 124 | +dotnet_diagnostic.IDE0075.severity = none # Simplify conditional expression |
| 125 | +dotnet_diagnostic.JSON002.severity = none # Probable JSON string detected |
| 126 | + |
| 127 | +# --- Unused Code Detection --- |
| 128 | +dotnet_diagnostic.IDE0005.severity = none # Using directive is unnecessary |
| 129 | + |
| 130 | +# --- Parentheses Preferences --- |
| 131 | +dotnet_diagnostic.IDE0047.severity = none # Parentheses can be removed |
| 132 | +dotnet_diagnostic.IDE0048.severity = none # Parentheses should be added for clarity |
| 133 | + |
| 134 | +# --- Pattern Matching --- |
| 135 | +dotnet_diagnostic.IDE0019.severity = none # Use pattern matching |
| 136 | +dotnet_diagnostic.IDE0020.severity = none # Use pattern matching |
| 137 | +dotnet_diagnostic.IDE0038.severity = none # Use pattern matching |
| 138 | +dotnet_diagnostic.IDE0078.severity = none # Use pattern matching |
| 139 | +dotnet_diagnostic.IDE0083.severity = none # Use pattern matching |
| 140 | + |
| 141 | +# --- If Statement Simplification --- |
| 142 | +dotnet_diagnostic.IDE0045.severity = none # Use conditional expression for assignment |
| 143 | +dotnet_diagnostic.IDE0046.severity = none # Use conditional expression for return |
| 144 | + |
| 145 | +# =================================================================== |
| 146 | +# COMPILER WARNINGS (C# 8.0+ Nullable Reference Types) |
| 147 | +# =================================================================== |
| 148 | +dotnet_diagnostic.CS8600.severity = none # Converting null literal or possible null value to non-nullable type |
| 149 | +dotnet_diagnostic.CS8601.severity = none # Possible null reference assignment |
| 150 | +dotnet_diagnostic.CS8602.severity = none # Dereference of a possibly null reference |
| 151 | +dotnet_diagnostic.CS8603.severity = none # Possible null reference return |
| 152 | +dotnet_diagnostic.CS8604.severity = none # Possible null reference argument |
| 153 | +dotnet_diagnostic.CS8618.severity = none # Non-nullable property initialization |
| 154 | +dotnet_diagnostic.CS8625.severity = none # Cannot convert null literal to non-nullable reference type |
| 155 | + |
| 156 | +[*.jsonc] |
| 157 | +insert_final_newline = false |
| 158 | +trim_trailing_whitespace = false |
0 commit comments