Export Visual Studio's 'Code Style settings' as .editorconfig

I realise this isn't much help for VS2017 users, but VS2019 has a button "Generate .editorconfig file from settings" on the Code Style options page.

However, if I may add a Question to an Answer - does anyone know if it's possible to import the .editorconfig file so that the options settings on the local machine then match what's in the .editorconfig file? This would be a really useful way of taking a .editorconfig file, changing the settings and re-exporting it while ensuring that any inadvertent changes that might have been made to the Code Style options since the previous export do not get exported.


I know this question is ancient but worth an answer...

The latest Visual Studio extension allows you to do this (Guide here):

Basically install the extension and right click on the solution or project (you can restrict the rules to solution/project or even folder) and click add > new EditorConfig (IntelliCode)

There are still some restrictions about what you can do in the latest releases of Visual Studio, but Visual Studio 2017 15.8 Preview 3 or higher allow you to use a new extended “Format Document” command to perform additional code cleanup for the current document.

It's a shame you can't make all your rules cause build errors, only some of the options allow this - without this, a lot of the styling options can be ignored.