[英]Check jshint errors before npm run build
I have setup webpack using npm.我已经使用 npm 设置了 webpack。 I installed jshint using
npm install jshint --save-dev
.我使用
npm install jshint --save-dev
。
Now if I run command jshint assets/js/index.js
i get errors.现在,如果我运行命令
jshint assets/js/index.js
我得到错误。
I want to check the errors on npm run build
我想检查
npm run build
上的错误
You can change your build script in the package.json in the way to run lint and then if it successful run build.您可以通过运行 lint 的方式更改 package.json 中的构建脚本,如果成功则运行构建。 See example
查看示例
{
...
"scripts": {
"build": "npm run lint && your_build_command",
"lint": "jshint assets/js/index.js"
}
...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.