Fork me on GitHub

JSLint Error Explanations

JSLint will hurt your feelings. It's time to make them better!


A constructor name should start with an uppercase letter

When do I get this error?

JSHint will throw the "A constructor name '{a}' should start with an uppercase letter" error when it encounters an identifier following the new operator, when the newcap option is set to true and the identifier in question is not an own property of the global object. In the following example we attempt to instantiate a "class" myClass (we can assume that it has been declared elsewhere):

This is the JSHint equivalent of the "A constructor name '{a}' should start with an uppercase letter" error from JSLint. although it occurs under slightly different circumstances. More detail about the root cause and reasons behind it can be found on the page for the JSLint message.

In JSHint 1.0.0 and above you have the ability to ignore any warning with a special option syntax. The identifier of this warning is W055. This means you can tell JSHint to not issue this warning with the /*jshint -W055 */ directive.


comments powered by Disqus