new-cap
UnreleasedConfiguration
Rule Details
This rule requires constructor names to begin with an uppercase letter and
requires functions whose names begin with an uppercase letter to be called with
new.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
The object option supports newIsCap, capIsNew, newIsCapExceptions,
newIsCapExceptionPattern, capIsNewExceptions,
capIsNewExceptionPattern, and properties. The two checks and property
checking are enabled by default.
Differences from ESLint
ESLint's exception lookup also accepts names inherited from
Object.prototype, such as constructor and toString, because its exception
map is a plain JavaScript object. This is an upstream implementation accident.
rslint uses an explicit string set, so lowercase constructor names are reported
unless they are configured in newIsCapExceptions.