简体   繁体   中英

Avoid nodejs project build to fail due to eslint error

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.

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"

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