Home > front end >  Getting error while trying to add ngrx store after ESLint
Getting error while trying to add ngrx store after ESLint

Time:04-22

I have an angular 13 application with ESLent already in place.

I have added ngrx store and dev tools using

ng add @ngrx/store
ng add @ngrx/store-devtools

commands. now that when I try to add store

ng g store shared/Shared --module shared.module.ts      

I get an error

An unhandled exception occurred: Schematic "store" not found in collection "@angular-eslint/schematics".

.eslintrc file has changes

},
{
  "files": [
    "*.ts"
  ],
  "extends": [
    "plugin:ngrx/recommended"
  ]
}

and angular.json has this entry

  "cli": {
"defaultCollection": "@angular-eslint/schematics"
}

how can I retain ESLint and make ngrx work with it ?

CodePudding user response:

The default collection should be the one from NgRx, or you should execute the schematic by explicitly adding the schematic.

  "cli": {
"defaultCollection": "@ngrx/schematics"
}

or

ng generate @ngrx/schematics:store shared/Shared --module shared.module.ts      
  • Related