codeformatter
codeformatter copied to clipboard
Unused usings should be removed
If a file contains a using declaration that is not actually used it should be removed.
using System;
using System.Collections.Generic;
class Test
{
public static void Main()
{
Console.WritLine("not using generics");
}
}
I would like to take this one.
From my understanding, support for this would require a new ILocalSemanticFormattingRule
that would run the diagnostics looking for CS8019
warnings and removing the offending using
directives. As in the UsingLocationRule
, files with preprocessor directives should probably be ignored.
It would be great if you could specify some namespaces which should always be kept such as System.Linq.