Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Consistent behavior for rename and replace transforms (#348)
* Codify current behavior for all transforms targetting deprecated types * fix: Consistent behavior for rename and replace transforms
- Loading branch information
Showing
23 changed files
with
862 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"types-react-codemod": patch | ||
--- | ||
|
||
Ensure replace and rename codemods have consistent behavior | ||
|
||
Fixes multiple incorrect transform patterns that were supported by some transforms but not others. | ||
We no longer switch to `type` imports if the original type wasn't imported with that modifier. | ||
Type parameters are now consistently preserved. | ||
We don't add a reference to the `React` namespace anymore if we can just add a type import. | ||
|
||
This affects the following codemods: | ||
|
||
- `deprecated-legacy-ref` | ||
- `deprecated-react-child` | ||
- `deprecated-react-text` | ||
- `deprecated-react-type` | ||
- `deprecated-sfc-element` | ||
- `deprecated-sfc` | ||
- `deprecated-stateless-component` | ||
- `deprecated-void-function-component` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.