TypeName | SA1217UsingStaticDirectivesMustBeOrderedAlphabetically |
CheckId | SA1217 |
Category | Ordering Rules |
📝 This rule is new for StyleCop Analyzers, and was not present in StyleCop Classic.
The using static
directives within a C# code file are not sorted alphabetically by full type name.
A violation of this rule occurs when the using static
directives are not sorted alphabetically by full type name. Sorting the using static
directives alphabetically makes the code cleaner and easier to read.
To fix an instance of this violation, order the using static
directives alphabetically by full type name.
#pragma warning disable SA1217 // Using static directives should be ordered alphabetically
using static System.Math;
#pragma warning restore SA1217 // Using static directives should be ordered alphabetically