![](/img/trans.png)
[英]Custom TSLint Rule in TypeScript with Angular 7 and `ng lint`
[英]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.