ng lint在gitlab CI上找不到带有Angular CLI的自定义规则目录:codelyzer



ng lint在Gitlab CI上失败,返回错误消息An unhandled exception occurred: Failed to load /builds/trade-up/trade-up/common/projects/trade-up-common/tslint.json: Could not find custom rule directory: codelyzer

ng lint在我的本地机器上运行没有问题,但在gitlab CI上失败。

在交换通用包中,我已将tslint.json添加到.npmignore文件中。Codelyzer包含在主angular应用程序和通用包的依赖项中。

您必须安装代码分析器

npm install codelyzer

然后在规则目录中定义:

"rulesDirectory": [
"node_modules/codelyzer"
],

这实际上是由错误的导入引起的。父应用程序引用了我的自定义包的本地版本,而不是发布到npm的版本。

最新更新