Skip to main content

RCS1260: Add/remove trailing comma

Properties

PropertyValue
Default Severitydisabled by default
Minimum language version-

Examples

Example #1

.editorconfig
roslynator_trailing_comma_style = include
diagnostic.cs
public enum Foo
{
A,
B,
C
}
fix.cs
public enum Foo
{
A,
B,
C,
}

Example #2

.editorconfig
roslynator_trailing_comma_style = omit_when_single_line
diagnostic.cs
public enum Foo { A, B, C, }
fix.cs
public enum Foo { A, B, C }

Configuration

info

Option roslynator_trailing_comma_style is required to be set for this analyzer to work.

.editorconfig
# Include/omit trailing comma in initializer or enum
roslynator_trailing_comma_style = include|omit|omit_when_single_line

Applies to