It is not recommended to use the UTF-8-BOM format for web development; instead, use UTF-8, as it adds the  symbol at the beginning of the file, which increases uncertainty for web development (present locally, but not on the server after compilation), Google.
After creating the .editorconfig file, you can execute the dotnet format command in the project root directory to format the entire project.