All rules
IDE2003Language rules (new-line preferences)

Blank line required between block and subsequent statement

Blank line required between block and subsequent statement

Microsoft docs

Description

This style rule enforces that there should be a blank line between a block statement and any subsequent statement at the same scope level. This improves code readability by visually separating different logical sections of code.

Examples

Avoid
// dotnet_style_allow_statement_immediately_after_block_experimental = true
if (true)
{
    DoWork();
}
return;
Prefer
// dotnet_style_allow_statement_immediately_after_block_experimental = false
if (true)
{
    DoWork();
}

return;

Configurable options

Vote for the value each option should take in the generated .editorconfig.

dotnet_style_allow_statement_immediately_after_block_experimental
default: true
Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0