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.


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

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

Comment actions Permalink
Official comment

Hello Terrence!


Thank you for contacting us.

Currently R# doesn't support option of keeping trailing comma, here's corresponding feature request -

Please feel free to comment or vote for it.

Thank you.

Comment actions Permalink

Excellent; thank you.


Please sign in to leave a comment.