I have integrated JSLint (http://javascriptlint.com) into my projects post build - but can't seem to get it to fail the build if an error/warning occurs?
Currently JSLint is ran from a .bat file that gets executed on post-build
Is there a param I can pass in to tell JSLint to fail the build if error/warning is encountered?
Thanks in advance folks
The JSLint extension for VS2010 has an option to automatically display JSLint warnings in the error list. In addition, you can run JSLint on build and cancel the build if a rule is violated.
Or, if you would like to continue running JSLint through a batch script, you could force MSBuild to raise an error depending on the return exit code of the script:
<Target Name="AfterBuild">
<Exec Command="jslint.bat" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Text="Error running JSLint" Condition="'$(ErrorCode)'>'0'" />
</Target>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With