Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To remove unused symbols from standalone Angular components’ imports arrays, run ng generate @angular/core:cleanup-unused-imports from your Angular project. The schematic cleans these template-related imports across the project; it is not a general-purpose cleanup for every unused TypeScript import.
What Angular’s unused-import cleanup removes
Angular’s cleanup targets symbols listed in a component’s imports array that the component template does not use. Angular says it reports these unused component imports as of version 19. Its documented example removes an unused directive from both the TypeScript import declaration and the component’s imports array, while leaving the used Component import in place. See Angular’s cleanup-unused-imports migration documentation.
The distinction matters: the command addresses Angular template dependencies, not every unused import in your TypeScript files. The migration documentation does not promise to remove ordinary TypeScript imports that are unrelated to a component template.
Run the project-wide cleanup schematic
- Open a terminal at the root of the Angular project you want to update.
- Run
ng generate @angular/core:cleanup-unused-imports. - Review the changes in your version-control diff. Confirm that the removed symbols are unused by their component templates and that the schematic has not changed anything unexpected.
- Run your project’s usual checks, such as its build and tests, before accepting the changes.
Angular describes the schematic as cleaning unused imports throughout the project. Its documentation does not publish test results, measured cleanup rates, or guaranteed bundle-size savings, so review and verify the source changes rather than assuming a particular outcome.
#1 Best Overall
Use editor diagnostics for ongoing cleanup
Angular’s language-service release history includes diagnostics for unused standalone imports and a code fix. These editor features can help identify or fix an unused import while you work, whereas the documented schematic is the project-wide cleanup command. See the Angular Language Service changelog.
If diagnostics or code fixes behave unexpectedly, check which TypeScript package your editor is using. The Angular Language Service README explains that the service depends on Angular language-service and TypeScript packages, and warns that selecting a separate TypeScript package can cause an API mismatch. See the Angular Language Service README.
Quick Recap
Rank #4
Rank #3
Rank #2
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors

