Search code examples
c#.net-5static-code-analysiseditorconfig

Is there way to define required class members order in the .editorconfig file?


I use .editorconfig file to define code style rules in my .Net 5 solution. Is it possible to define required class members order in the .editorconfig? For example, public members should appear before private, non-static members should appear before static and methods before properties.


Solution

  • You cannot define order of members in class using editorconfig, but you can write custom analyzer using Roslyn or use CodeMaid extensions for VS2019, not sure about VSCode extensions enter image description here