Support for trailing comma in multi-line initializer or list

In my effort to configure ReSharper to support the StyleCop.Analyzers rules; I am unable to find a configuration that supports SA1413 Use Trailing Commas In Multi Line Initializer.

See: https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1413.md

As an example, the ReSharper code cleanup removes the trailing comma of the last item in the lists:

var x = new Barnacle
{
    Age = 100,
    Height = 0.2M,
    Weight = 0.88M,
};

private enum ExceptionArgument
{
DictionaryCreationThreshold,
Key,
}

I found inspection severity options that affect inspection but nothing to affect code format / cleanup.

1
2 comments
Official comment

Hello Terrence!

 

Thank you for contacting us.

Currently R# doesn't support option of keeping trailing comma, here's corresponding feature request - https://youtrack.jetbrains.com/issue/RSRP-452880

Please feel free to comment or vote for it.

Thank you.

Excellent; thank you.

0

Please sign in to leave a comment.