Require PascalCased class and interface names (class-name-casing)
This rule enforces PascalCase names for classes and interfaces.
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 aims to make it easy to differentiate classes from regular variables at a glance. The _
prefix is sometimes used to designate a private declaration, so the rule also supports a name that might be _Example
instead of Example
.
Options
This rule has an object option:
"allowUnderscorePrefix": false
: (default) does not allow the name to have an underscore prefix"allowUnderscorePrefix": true
: allows the name to optionally have an underscore prefix
Examples
Examples of incorrect code for this rule:
Examples of correct code for this rule:
When Not To Use It
You should turn off this rule if you do not care about class name casing, or if you use a different type of casing.
Further Reading
class-name
in TSLint
Last updated