Fork me on GitHub

JSLint Error Explanations

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


Nested comment

When do I get this error?

JSLint will throw the "Nested comment" error when it encounters the characters /* inside a multiline comment. Here's an example:

Why do I get this error?

This error is raised to highlight a potentially dangerous piece of code. While it is valid to include the /* string in a multiline comment, it is not valid to include the */ string. If you were to do so, everything following the first */ will be parsed as if it is not part of the comment. Here's an example (notice the syntax highlighting which demonstrates the error):

Like it does for many of its errors, JSLint takes the safe approach and forbids the use of the string /* anywhere in a multiline comment.


comments powered by Disqus