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

Time:11-30

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

CodePudding user response:

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

  • Related