Line length enforcement for Visual Studio and dotnet format?

Jan Tache 26 Reputation points

Many other language ecosystems have coding styles or standardized formatting tools with line length enforcement. E.g:

JS/TS: Prettier
C in the Linux kernel: Convention of 80 character line length
Rust: rustfmt

The idea behind the line length limit it is that there is an ideal character/column length for legibility. For books this is around 60. 60 is too few for code; for code it is typically 80-120 characters. Visual Studio and C#/.NET doesn't have a line length format option, same as the dotnet format tool. I think this option would be great to have in Visual Studio and/or the dotnet format tool.

The benefit of having our tools enforce the line lengths makes it so teams spend less time checking/enforcing/discussing this specific style point.

What are the reasons this particular option isn't included as of now? Could this be reasonably added?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,084 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,456 questions
0 comments No comments
{count} vote

Accepted answer
  1. Karen Payne MVP 34,586 Reputation points

    I've not used Visual Studio without Resharper for a long time but would think that word wrap could include a setting for when to wrap like Resharper.


0 additional answers

Sort by: Most helpful