I am setting up a Jenkins CI pipeline which will be triggered every time a new PR is opened. The pipeline has a job that will run ESLint to identify any errors.
Currently, the project has like 1000 lint errors and 2000 warnings. Team plans to fix them overtime. For now, we want to fail the Jenkins job , if errors or warnings exceed 1000 or 2000 respectively.
I have looked into the ESLint documentation. It provides a max-warnings flag , that can be used to return non zero exit code if warnings exceed that number.
How can I do the same thing for the errors, any suggestions?