Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export Resharper code style settings into Editor.Config

I am trying to create a single place for code-style and formatting rules for our solution.

We are currently using Resharper, which stores this info in the {slnName}.dotSettings file. However, some developers don't want to use Resharper due to its performance issues. So they don't get these rules and warnings.

EditorConfig seemed like a suitable replacement, but I wanted to translate the ReSharper rules (where possible) into editor config rules and also include all the ReSharper specific rules so that those who do use ReSharper get the extra rules too, and they are all stored in one place (One source of truth!).

Anyway, trying to grasp what the .dotSettings file is doing has been unfruitful, and I know that Resharper will read in editor config files, so I'd like it to export it too

like image 523
Dave Avatar asked May 08 '19 10:05

Dave


People also ask

Where are ReSharper settings stored?

ReSharper provides a default option of keeping team preferences in a separate file, which is saved in the solution folder and can be easily added to your VCS.

How do I create an EditorConfig file?

Select the editorconfig File (default) template to add an EditorConfig file prepopulated with two core EditorConfig options for indent style and size. Or, select the editorconfig File (. NET) template to add an EditorConfig file prepopulated with default . NET code style, formatting, and naming conventions.

How do I change my ReSharper settings?

To configure the main set of ReSharper preferencesIn the Visual Studio menu, choose ReSharper | Options. In the Options dialog that appears, select a node in the left pane and configure settings in the right pane. Use the search box in the left top corner to find a specific preference.

What is .EditorConfig file?

The EditorConfig project consists of a file format for defining coding styles and a collection of text editor plugins that enable editors to read the file format and adhere to defined styles. EditorConfig files are easily readable and they work nicely with version control systems.


1 Answers

With Resharper 2019.1 you can now 'Export settings to .editorconfig'. The option lives in Resharper -> Tools.

This will export the standard editor config options, the Visual Studio specific config options and the resharper specific configs. Very useful!

like image 78
Dave Avatar answered Oct 09 '22 06:10

Dave