angular-eslint: Linter failing to read angular.json after v16 migration

Reopening this issue here. I see the dependency is from https://github.com/angular-eslint.

Description and reproduction of the issue

As of Angular v16, the linter is failing to run. Not failing to pass but entirely failing to run. From the error message, it looks to me, it is looking for the angular.json in the wrong directory. The linter does run and pass on v15. Interestingly, ng test is still working as expected.

When running ng lint: (file not found is to be expected as that is not where the angular.json is)

image

The contents of the error file are:

image

Versions

Angular CLI: 16.0.0                                           
Node: 18.15.0                                                 
Package Manager: npm 9.5.0                                    
OS: win32 x64                                                 
                                                              
Angular: 16.0.0                                               
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, localize, material, platform-browser               
... platform-browser-dynamic, router, service-worker          
                                                              
Package                         Version                       
---------------------------------------------------------     
@angular-devkit/architect       0.1600.0
@angular-devkit/build-angular   16.0.0
@angular-devkit/core            16.0.0
@angular-devkit/schematics      16.0.0
@angular/fire                   7.5.0
@angular/flex-layout            14.0.0-beta.41
@schematics/angular             16.0.0
ng-packagr                      16.0.0
rxjs                            7.8.1
typescript                      5.0.4

The project is a yarn berry mono-repo, it looks like the CLI is only looking in the root folder. Failing on both my local machine (windows 10) and out CI/CD pipeline (node 16 alpine).

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Thanks folks, I have been able to reproduce this using a simple npm workspace setup with Angular nested inside. We will discuss this and figure out a resolution this week

Am I right in saying that you are all experiencing when:

  • using npm/yarn/pnpm workspaces
  • AND the angular.json is located in a nested location, ie it is one of the workspaces within the repo, not at the root of the repo

Thanks all, this is now resolved in 16.0.2