From 14fb8ce4c00fc458cfbe1d7f2c85638c6165b636 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 9 Jan 2025 15:42:10 +0100 Subject: [PATCH] fix(migrations): resolve text replacement issue (#59452) Based on https://github.com/angular/angular/pull/59353#issuecomment-2580320424, fixes a text replacement issue that seems to cause code to be duplicated in some setups. PR Close #59452 --- .../core/schematics/ng-generate/cleanup-unused-imports/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/schematics/ng-generate/cleanup-unused-imports/index.ts b/packages/core/schematics/ng-generate/cleanup-unused-imports/index.ts index cb84a4e14e3..70cd7898d68 100644 --- a/packages/core/schematics/ng-generate/cleanup-unused-imports/index.ts +++ b/packages/core/schematics/ng-generate/cleanup-unused-imports/index.ts @@ -67,7 +67,7 @@ export function migrate(): Rule { for (const c of changes) { recorder .remove(c.data.position, c.data.end - c.data.position) - .insertLeft(c.data.position, c.data.toInsert); + .insertRight(c.data.position, c.data.toInsert); } tree.commitUpdate(recorder); }