NOT SUPPORTED: keyword "id", use "$id" for schema ID : TSLint (ng add @angular-eslint/schematics)

Viewed 19324

I am upgrading my Angular 10 application to Angular 13. I did well with other compatibilities of dependencies. The project is compiling and working fine. Now the time for TSLint I tried to update the lint with the below command.

ng add @angular-eslint/schematics

But getting the error message:

An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID
6 Answers

I solved the problem downgrading angular cli version to 12

enter image description here

It seams that a lot of packages throw this error. I had the same error when adding NgRx store. It looks like that installing the latest version of the packages usually fix the issue:

ng add package_name/@latest

I had the same problem. I could fix it by by upgrading angular/universal to the same version as my angular version is.

I had a conflict where the third-party package I was using had been replaced by an official one, but for some reason I had both of them in my package.json file The real issue though was that the angular.json file was using the older builder instead of the newer one. I removed the package and used ng add to add the new package via its schematic, and after that things started working properly.

I faced the same issue in Angular 14, IONIC 6 project while generating pages/components . And resolved it by replacing id with $id manually on following paths:

  1. node_modules > @Ionic > angular-toolkit > schematics > page > schema.json > replace id with $id on line 3.

  2. node_modules > @Ionic > angular-toolkit > schematics > component > schema.json > replace id with $id on line 3.

Related