Skip to content

Conversation

wdolek
Copy link

@wdolek wdolek commented Aug 25, 2025

This PR updates the default .editorconfig file generated by calling dotnet new editorconfig, so that generated file contains:

dotnet_separate_import_directive_groups = false

(default value) instead of true.

Rationale

The current template sets dotnet_separate_import_directive_groups to true, which causes IDEs and analyzers to insert blank lines between groups of using directives.

In practice, this style does not appear to be widely adopted in the .NET ecosystem - neither in Microsoft-maintained repositories nor in many popular community libraries. From reviewing current codebases, the more common convention is to omit blank lines between using groups.

While formatting preferences are subjective, leaving this setting at its default (false) better aligns the generated template with the style most developers are likely to encounter in existing .NET projects. It also avoids surprising developers who run dotnet new editorconfig and later have to change this value back during code reviews.


This is a minor change, but if I’ve missed any additional template/test updates, please let me know and I’ll adjust.

@wdolek wdolek requested a review from a team as a code owner August 25, 2025 19:34
Copy link
Contributor

This PR is targeting main, which is now for .NET 11-facing work. If you intended to target .NET 10, either retarget this PR to release/10.0.1xx or make sure you backport the change to release/10.0.1xx after merging. See #50394 for more details.

@marcpopMSFT marcpopMSFT added the Area-Common templates Covers templates in the repo (classlib, console, common item templates) label Aug 28, 2025
@wdolek wdolek force-pushed the editorconfig-dotnet-template-default-separation-of-imports branch 2 times, most recently from 3227a66 to 873ed26 Compare September 8, 2025 08:46
@wdolek wdolek force-pushed the editorconfig-dotnet-template-default-separation-of-imports branch from 873ed26 to fd3ee3f Compare September 10, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Common templates Covers templates in the repo (classlib, console, common item templates) Area-Infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants