Please apply EditorConfig settings to template files
See original GitHub issueWhen creating projects and solutions using dotnet new
, it doesn’t respect an existing EditorConfig file, and you end up with 2-space indentation, CRLFs, and some files (like launchSettings.json
) with a BOM.
This isn’t very cross-platform-friendly. In fact, the project was added from Linux, and I still got CRLFs.
Please:
- Read and apply settings from an existing EditorConfig file.
- If there is no EditorConfig file, apply settings based on the OS (f.e. LF on Linux and macOS).
This should not require any parsing or understanding of the template itself. Most text-like files can have these settings applied, or you can maintain a simple list of files (file extensions) that support them.
The following EditorConfig settings should be applied:
charset end_of_line indent_size indent_style insert_final_newline trim_trailing_whitespace
This would make it easier to get started without having to spend time fixing the files.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (3 by maintainers)
Top GitHub Comments
@JanKrivanek
The problem with that is that
dotnet format
doesn’t support files like .csproj .sln, .cshtml .razor, or other template files likeappsettings.json
, etc.I wonder if
dotnet format
should add support for basic EditorConfig formatting in all (most) file types.Related: https://github.com/dotnet/templating/issues/1248