Since Angular 19
You can clean unused imports easily with a new schematic:
$ ng generate @angular/core:cleanup-unused-imports