简体   繁体   中英

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. Is it possible to configure Angular cli on this purpose?

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!:)

Indeed, you need to use npm command to start the app instead of ng serve.

It looks like:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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