We've just upgraded to the NPM version of JSHint in Windows, and our CI won't fail on JSHint failures anymore. This feels like a silly problem, but I can't figure it out.
We're running NAnt and CCNet. When we try to run jshint.cmd from within NAnt, it fails saying that the path is wrong. I can't hard code the path in the script because each dev station (and CI server) has NPM and JSHint installed in a different location ("C:\Users\me\AppData\Roaming\npm").
So we've written a batch file which NAnt calls, which calls jshint.cmd. It now runs JSHint, but won't give error codes or fail properly. It looks like the end of our batch file is not run after the jshint.cmd fails, and it looks like there is no errorlevel set for NAnt to check against. I've tried checking resultproperty in NAnt as well with no luck.
Here's a few files:
JSHint.build
<target name="JSHint">
<exec program="runjshint.cmd" basedir="${jshint.dir}" workingdir="${jshint.dir}">
<arg value="${scripts.dir}" />
</exec>
</target>
runjshint.cmd
jshint --reporter=reporter.js %1
REM Everything past here isn't run.
NAnt output
[exec] C:\work\ThirdParty\jshint>jshint --reporter=reporter.js ..\..\src\Scripts
[exec]
[exec]
[exec] jshint failed:
[exec]
[exec] ..\..\src\Scripts\app\ViewModels\FakeViewModel.js: line 62, col 31, 'FakeVariable' is not defined.
[exec] ..\..\src\Scripts\app\ViewModels\FakeViewModel.js: line 78, col 33, 'FakeVariable' is not defined.
[exec]
[exec] 2 errors
BUILD SUCCEEDED
Note that the build succeeded even though JSHint failed.