让 JSLint 打破 Visual Studio 2010 中的构建
我已将 JSLint (http://javascriptlint.com) 集成到我的项目构建后 - 但如果发生错误/警告,似乎无法使其构建失败?
目前 JSLint 是从在构建后执行的 .bat 文件运行的。
如果遇到错误/警告,我是否可以传递一个参数来告诉 JSLint 使构建失败?
预先感谢各位
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
VS2010 的 JSLint 扩展 具有自动显示 JSLint 警告的选项在错误列表中。此外,您可以在构建时运行 JSLint,并在违反规则时取消构建。
或者,如果您想通过批处理脚本继续运行 JSLint,您可以强制 MSBuild 根据脚本的返回退出代码引发错误:
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: