3

I'm trying to set up lint-staged with my Angular monorepo workspace, however I can't make it work. When ng lint --files is executed with changed file it errors that *file* is not part of a TypeScript project. If I run ng lint <project> --files it works. Can Angular lint all projects using files from lint-staged?

I need to run linting of only changed parts, but I don't see how I can achieve this.

I've no default project in angular.json, however ng lint appears to start from the first project and if it doesn't find the file it errors.

Sergey
  • 7,184
  • 13
  • 42
  • 85

1 Answers1

1

There are some command line arguments problem with ng lint. You need to use this shim: https://www.npmjs.com/package/ng-lint-staged