2

Context

We have a nodejs project which gets built and deployed through Jenkins pipeline. During the build step, it performs eslint for all the .js files under a directory and generate eslint report. In case of any eslint error, the Jenkins pipeline fails.

Problem statement

We have introduced a sub-directory which contains further .js files. We want to generate eslint report for this, but don't want to fail the pipeline in case of any eslint error.

Can anyone please suggest how can we solve this?

Thanks in advnace.

Sonu
  • 65
  • 3
  • 10

1 Answers1

0

It depends how eslint is performed.

With gyandeeps/gruntify-eslint task, there is a silent option which allows to not fail the job on errors.

In a regular shell step, you can force the command to not fail with:

sh "<your eslint  command> || true"
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250