All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rules.jshint.E017.html Maven / Gradle / Ivy

Go to download

Consume reports generated by jshint for code quality. Also consume reports for code duplication (either simian or cpd). Consumes the unit/integration tests reports (generated by Jasmin) coverage report (lcov generated by Istanbul). The information generated by reports are added in Sonar

There is a newer version: 2.1.0
Show newest version

    

When do I get this error?

The "Unclosed comment" error is thrown when JSLint or JSHint encounters a multiline comment that does not end with the character sequence */. Here's an example:

x
 
1
/* This is a comment
2
 * but I forgot to
3
 * close it.
4
JSLint found 1 errorVersion 2015-09-23
Line 4:Unclosed comment.

Why do I get this error?

This error is raised to highlight a fatal JavaScript syntax error. Your code will not run unless you fix this issue. The ECMAScript 5 specification lists the following grammar for multiline comments (ES5 §7.4):

MultiLineComment ::
    /* MultiLineCommentCharsopt */

We can see from the above quote that multiline comments must end with the */ characters. If you have an unclosed multiline comment a syntax error will be thrown when the interpreter reaches the end of the file. Here's the above snippet once more, except we've closed the comment this time:

4
 
1
/* This is a comment
2
 * but I remembered to
3
 * close it. */
4
JSLint found no errorsVersion 2015-09-23

In JSHint 1.0.0 and above you have the ability to ignore any warning with a special option syntax. Since this message relates to a fatal syntax error you cannot disable it.

JSHint bug alert

Fixed as of JSHint 1.0.0. As you may have noticed if you have switched one of the examples above to use a pre-1.0.0 version of JSHint instead of JSLint, a large number of the same message appear to get generated for the first unclosed comment, to the point where the parser gives up and tells you that there are too many errors.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy