jslint flagging "dangerous comment"

javascript, jslint

Solution

"Dangerous" comments match the regular expression:

/@cc|<\/?|script|\]\s*\]|<\s*!|&lt/i

In this case, your comment is "dangerous" because it contains the string "script".

I think this is probably a false positive.

Problem

Given this JavaScript code (which is just a comment referring to a url): ``` // see http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/ ``` JSLint with "Safe Subset" turned on will say ``` Dangerous comment. // http://enterprisejquery.com/2010/10/how-good-c-habits-can-encourage-bad-javascript-habits-part-1/ ``` How can a comment be dangerous? Comments, by definition, aren't parsed! Or are they? Edit: Using a different url isn't necessarily dangerous. For example this: ``` // http://enterprisejquery.com ``` doesn't trigger the flag. How can one URL in a comment be 'dangerous', but another isn't?

Original source

Related problems