Brian Buttolph - 2010-10-19

We recently integrated JavaScript Lint with our AccuRev pre-promote trigger to send an email to the developer if the utility finds an error in a .js file being promoted. Since AccuRev doesn't have the actual .js file itself but does have its contents, we place the contents in a temporary file and provide it to JavaScript Lint as the argument to the -process option. This temporary file has the extension .tmp.

During the promotion of one of our files, JavaScript Lint reports "html error: unable to find end of script tag" with 0 errors, 0 warnings. However, the program's return value is 3, which indicates an error has occurred and thus an email is sent to the developer.

A file compare (binary and text) of the .js file and the temp file show no differences. If we simply rename the temp file to have a .js extension, the program reports 0 errors, 905 warnings! The program's return value is 0. Why would it matter what the file extension is? Is this a known bug?

Thanks in advance.