From c43da92978819b1bf553dff3455155ec32ae7979 Mon Sep 17 00:00:00 2001 From: Amirabbas Ghasemi Date: Sun, 19 Jan 2025 12:53:21 +0330 Subject: [PATCH 1/2] fix: fix findPatterns posisble null in codemod/react/19/replace-create-factory --- codemods/react/19/replace-create-factory/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codemods/react/19/replace-create-factory/src/index.ts b/codemods/react/19/replace-create-factory/src/index.ts index c08a5961..b96a4235 100644 --- a/codemods/react/19/replace-create-factory/src/index.ts +++ b/codemods/react/19/replace-create-factory/src/index.ts @@ -17,7 +17,7 @@ export default function transform( let isDirty = false; - findPatterns(j, root).forEach((path) => { + findPatterns(j, root)?.forEach((path) => { const arg0 = path.value.arguments.at(0); if (!arg0) { From 74c18af190bf30631b1e7488c3fa135c337d2acc Mon Sep 17 00:00:00 2001 From: Amirabbas Ghasemi Date: Sun, 19 Jan 2025 12:54:34 +0330 Subject: [PATCH 2/2] fix: fix test fixtures in codemod/react/19/replace-create-factory --- .../__testfixtures__/identifier.output.ts | 2 +- .../__testfixtures__/string-tag-name.output.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codemods/react/19/replace-create-factory/__testfixtures__/identifier.output.ts b/codemods/react/19/replace-create-factory/__testfixtures__/identifier.output.ts index 959d10c2..028f9f22 100644 --- a/codemods/react/19/replace-create-factory/__testfixtures__/identifier.output.ts +++ b/codemods/react/19/replace-create-factory/__testfixtures__/identifier.output.ts @@ -1 +1 @@ -const route = ; \ No newline at end of file +const route = ; diff --git a/codemods/react/19/replace-create-factory/__testfixtures__/string-tag-name.output.ts b/codemods/react/19/replace-create-factory/__testfixtures__/string-tag-name.output.ts index 0828ece8..e796fb14 100644 --- a/codemods/react/19/replace-create-factory/__testfixtures__/string-tag-name.output.ts +++ b/codemods/react/19/replace-create-factory/__testfixtures__/string-tag-name.output.ts @@ -1 +1 @@ -const button =