Enforces naming of generic type variables (generic-type-naming)
It can be helpful to enforce a consistent naming style for generic type variables used within a type. For example, prefixing them with T
and ensuring a somewhat descriptive name, or enforcing Hungarian notation.
DEPRECATED
This rule has been deprecated in favour of the naming-convention
rule. It will be removed in a future version of this plugin.
Rule Details
This rule allows you to enforce conventions over type variables. By default, it does nothing.
Options
The rule takes a single string option, which is a regular expression that type variables should match.
Examples of correct code with a configuration of '^T[A-Z][a-zA-Z]+$'
:
Examples of incorrect code with a configuration of '^T[A-Z][a-zA-Z]+$'
:
When Not To Use It
If you do not want to enforce a naming convention for type variables.
Further Reading
Last updated