Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

ng lint fails on Gitlab CI with the error message 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 is running without issues on my local machine but failing on gitlab CI.

In the trade-up-common package, I have added tslint.json to the .npmignore file. Codelyzer is included in the dependencies of both the main angular app and the common package.

like image 350
T. SvZ Avatar asked Oct 27 '25 07:10

T. SvZ


1 Answers

You have to install codelyzer

npm install codelyzer

then define in the rules directory :

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

UPDATE:

If your tslint.json is different, try this:

"rules": {
    "directive-selector": [
        "codelyzer"
    ],
like image 124
Pterrat Avatar answered Oct 28 '25 22:10

Pterrat