简体   繁体   中英

How to ingore tslint.json file in angular2 of another project?

I have an angular app which has another standalone angular app as a dependency. Everything works fine apart from the linting.

The problem is when I run ng lint in my terminal I get the following error:

Failed to load path.... node/modules/codelyzer.

When I remove my tslint.json from the dependency project the error resolves immediately.

The problem is here obviously that angular sees two tslint.json , one from my main app and the other from the dependency project which is now part of the main app.

How can I solve this problem without manually deleting the tslint.json from the dependency project? I would like to keep it there.

I was thinking about excluding it in the angular.cli.json lint field, but wasn't successful. Also put an exclude in the tslint.json but didn't get positive results

I've found the problem, I've excluded tslint.json from my main app in the angular.cli.json by writing the following:

"lint": [
  {
  "project": "path/tslint.json",
  "exclude": "path/node_modules/my_project"
  }
]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM