Skip to content

fix(codemods/react/19/remove-legacy-context): improve and fix issues in remove-legacy-context codemod#42

Merged
amirabbas-gh merged 5 commits intomainfrom
fix_test_fixtures_react/19/remove-legacy-context
Feb 7, 2025
Merged

fix(codemods/react/19/remove-legacy-context): improve and fix issues in remove-legacy-context codemod#42
amirabbas-gh merged 5 commits intomainfrom
fix_test_fixtures_react/19/remove-legacy-context

Conversation

@amirabbas-gh
Copy link
Copy Markdown
Collaborator

📚 Description

This PR fixes multiple issues related to the remove-legacy-context codemod in the react/19 directory. The following changes were made:

  1. Fix the main codemod logic: Resolved functional issues in the remove-legacy-context codemod to ensure accurate transformation.

  2. Fix test fixtures: Corrected and updated test fixtures to align with the codemod's expected behavior.

  3. Handle null cases in findPatterns: Fixed a bug where findPatterns could return null, causing runtime errors during execution.

  4. Correct package address: Updated the @codemod.com/codemod-utils package address to the correct location in remove-legacy-context.


🧪 Test Plan

  1. Run tests for the remove-legacy-context codemod:
    npm test
  2. Validate the updated fixtures to confirm accurate test results.
  3. Ensure no runtime errors occur in scenarios where findPatterns previously returned null.
  4. Verify the updated @codemod.com/codemod-utils package address works as intended.

Comment on lines +24 to +26
"dependencies": {
"@codemod/utils": "^1.1.0"
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used and should be removed

@mohebifar mohebifar self-requested a review January 21, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants