'Remove unnecessary usings with dotnet format

We have dotnet format to apply formatting to csproj or even sln file for the entire solution.

I can do that using Visual Studio 2022 Quick Action Light Bulb feature.

Visaul Studio Quick Action Light Bulb feature in Visual Studio 2022

So is there a way I can do that using dotnet format command configured using editorconfig settings?



Solution 1:[1]

If you include the following in your .editorconfig file, it is now supported:

dotnet_diagnostic.IDE0005.severity = error

I tried to find anywhere in the changelog where this is referenced, without success.

However do be aware: that you might need to update your IDE, as Rider version 2021 doesn't know that tasks are standard now.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1