Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Eslint/Prettier fail on errors and warnings inside ci environment?

I have a Vue app using Eslint with Prettier. A Github action should check the code style, but npm run lint -- --no-fix only logs the warnings, the workflow doesn't fail.

My test PR:

enter image description here

The workflow passes although I would expect it to fail. Is there a flag for this? E.g.

npm run lint -- --no-fix --fail-on-errors-and-warnings

1 Answers

--max-warnings=0 this should do the trick.

like image 137
XenoiS Avatar answered Sep 07 '25 20:09

XenoiS