首页 > 解决方案 > 我是否能够绕过 Jenkins tsl 错误并继续构建?

问题描述

我的问题与 Jenkins 和 linting 错误有关。

当我npm run build在我的机器上本地运行时,我成功地构建了我的代码库,没有任何错误。

但是,当我npm run build在 Jenkins 上运行时,由于 linting 错误(通常与区分大小写的问题和 any 类型的变量有关)而导致作业失败。

这是一个例子:

ERROR in {jenkins-path-to-tsx-file} [tsl] ERROR in {jenkins-path-to-tsx-file}(3,35) TS2307: Cannot find module './ResetPasswordForm'.

ERROR in {jenkins-path-to-tsx-file} [tsl] ERROR in {jenkins-path-to-tsx-file}(38,29) TS7006: Parameter 'res' implicitly has an 'any' type.

我了解如何在我的应用程序代码中修复这些错误以消除这些错误。

我的问题是,我是否能够阻止由于这些错误而导致的构建失败,并将它们显示为警告,或者尽管出现上述错误,仍继续构建 Jenkins 作业?

标签: jenkinsnpm

解决方案


推荐阅读