All rules
IDE2001Language rules (new-line preferences)
Embedded statements must be on their own line
Embedded statements must be on their own line
Microsoft docsDescription
This style rule enforces that embedded statements (statements that are part of control flow constructs like if, while, and for) must be placed on their own line rather than on the same line as the control keyword.
Examples
Avoid
// csharp_style_allow_embedded_statements_on_same_line_experimental = true
for (int i = 0; i < 10; i++) Console.WriteLine(i); Prefer
// csharp_style_allow_embedded_statements_on_same_line_experimental = false
for (int i = 0; i < 10; i++)
Console.WriteLine(i);Configurable options
Vote for the value each option should take in the generated .editorconfig.
csharp_style_allow_embedded_statements_on_same_line_experimental default:
trueYour vote
Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0