CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
It is common that there is a trailing comma at the end of a array of items (I think our stylecop rules picks these up), but it would be nice to not have to always remember to add them and have the cleanup code in codemaid do it.
I'm not sure if I am missing where to set it or if the functionality is not in codemaid or indeed if its in visual studio 2022 and I cant find the setting (or find it in google)
Steps to recreate
Add the following code (which is missing the trailing comma
var animals = new List<string>() { "dog", "cat", "mouse" };
when running cleanup (for example on save) it should add the following comma after "mouse".
var animals = new List<string>() { "dog", "cat", "mouse", };
Current behavior
It does not add the trailing comma
Expected behavior
To add the trailing comma. I expect there would be some config to turn this on of off to users preference
Thanks for the suggestion. We do not currently have an option to add trailing commas to lists. I'm not sure if there's a native VS option, they've been iterating a lot recently.
Environment
Description
It is common that there is a trailing comma at the end of a array of items (I think our stylecop rules picks these up), but it would be nice to not have to always remember to add them and have the cleanup code in codemaid do it.
I'm not sure if I am missing where to set it or if the functionality is not in codemaid or indeed if its in visual studio 2022 and I cant find the setting (or find it in google)
Steps to recreate
var animals = new List<string>() { "dog", "cat", "mouse" };
var animals = new List<string>() { "dog", "cat", "mouse", };
Current behavior
It does not add the trailing comma
Expected behavior
To add the trailing comma. I expect there would be some config to turn this on of off to users preference