簡體   English   中英

ng lint 找不到自定義規則目錄:在 gitlab CI 上使用 Angular CLI 的 codelyzer

[英]ng lint Could not find custom rule directory: codelyzer with Angular CLI on gitlab CI

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 上失敗。

在 trade-up-common 包中,我已將tslint.json添加到.npmignore文件中。 Codelyzer 包含在主要 Angular 應用程序和公共包的依賴項中。

你必須安裝 codelyzer

npm install codelyzer

然后在規則目錄中定義:

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

這實際上是由錯誤的導入引起的。 父應用程序引用了我的自定義包的本地版本,而不是發布到npm的那個。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM