JetBrains Rider 2024.1 Help

Code Inspection: Use preferred style for trailing comma before new line in multiline lists

Category

Syntax Style

ID

ArrangeTrailingCommaInMultilineLists

EditorConfig

resharper_arrange_trailing_comma_in_multiline_lists_highlighting

Default severity

Hint

Language

C#

Requires SWA

No

This code inspection checks that trailing commas in multi-line declarations with multiple items and similar constructs (object, array, and collection initializers, as well as enums and switch expressions) conform to your code style.

Depending on your preferences, it either detects redundant trailing commas or missing trailing commas.

The preferences are configured on the Editor | Code Style | C# | Syntax Style page of JetBrains Rider settings Ctrl+Alt+S, under Trailing comma.

Last modified: 17 April 2024