I think I found the solution. When I create the .editorconfig file with right-click on the folder structure sidebar in Visual Studio Code and select Generate .editorconfig (thus letting the plugin to create it), it works.
Click on the empty area below the files: