react-codemod
react-codemod copied to clipboard
feat: add React 19 replace default props transform
📚 Description
This PR is created to update the react-codemod repository with the updates for the react/19/replace-default-props codemod and to align the open-source content of this codemod in react-codemod similar to the Codemod repository.
-
Added Codemod Utils Package
- Added
@codemod.com/codemod-utilspackage as a dependency to facilitate codemod development.
- Added
-
Added Custom TypeScript Configuration for Codemods
"Introduced
tsconfig.codemod.jsonto provide a dedicated TypeScript configuration for transforms from the Codemod repository.
A dedicatedtsconfig.codemod.jsonhas been added to support the new transform from the Codemod repository and ensure it has the required TypeScript configuration.
- New Transform: React 19 Replace Default Props
- Added a new transform
react-19-replace-default-propsto handle default props migration for React 19. - Comprehensive tests were included to ensure reliability and coverage.
- Available will using
npx codemod react/19/replace-default-props
- Added a new transform
🧪 Test Plan
The following steps were taken to ensure the changes function as intended:
- Ran the test suite to validate existing functionality and new transforms.
- Verified type resolution and TypeScript transform compatibility.
- To confirm accuracy, the
react-19-replace-default-propstransform was executed against test cases.