简体   繁体   English

如果有掉毛问题,是否可以打破服务版本?

[英]Is it possible to break ng serve build if there are linting issues?

I would like the ng serve stops if there are linting issues. 如果有掉毛问题,我希望ng服务停止。 Is it possible to configure Angular cli on this purpose? 是否可以为此目的配置Angular cli?

Thanks in advance! 提前致谢!

Ah! 啊! It was actually pretty easy! 实际上非常简单! Add npm lint script before npm start: It will exit before starting the server if there are linting issues!:) 在npm start之前添加npm lint脚本:如果有linting问题,它将在启动服务器之前退出!:)

Indeed, you need to use npm command to start the app instead of ng serve. 实际上,您需要使用npm命令来启动应用程序而不是ng服务。

It looks like: 看起来像:

"scripts": {
    "start": "npm run lint && ng serve",
    "lint" : "tslint" // your lint conf here..
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM