Inconsistent naming conventions can lead to confusion and errors when working in a team. This rule ensures that all generic type parameter names follow a consistent naming convention by checking them against a provided regular expression.
The default configuration follows Microsoft’s recommended convention:
To fix this issue, ensure that all generic type parameter names in your code follow the naming convention specified in the regular expression.
With the default parameter value ^T(([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?)?$:
Public Class Foo(Of tkey) ' Noncompliant End Class
Public Class Foo(Of TKey) ' Compliant End Class