From 170c8a4b2b30505060ba524b6fd86debecc4a2b0 Mon Sep 17 00:00:00 2001 From: Behnam Emamian Date: Sun, 7 Dec 2025 14:05:18 +1100 Subject: [PATCH] Add guideline for trailing commas in initializers Added guideline to include trailing commas in multi-line initializers to avoid MA0007 warnings. --- instructions/csharp.instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/instructions/csharp.instructions.md b/instructions/csharp.instructions.md index 8d6f4c20..c44afae7 100644 --- a/instructions/csharp.instructions.md +++ b/instructions/csharp.instructions.md @@ -30,6 +30,7 @@ applyTo: '**/*.cs' - Use pattern matching and switch expressions wherever possible. - Use `nameof` instead of string literals when referring to member names. - Ensure that XML doc comments are created for any public APIs. When applicable, include `` and `` documentation in the comments. +- Add a trailing comma after the last value in multi-line arrays, collection initializers, object initializers, and enum declarations to prevent MA0007 warnings. ## Project Setup and Structure