Repository navigation
Commit 7bb3b74
committed
fix(codemod): visit nested import types inside remapped specifiers
replaceSpecifier used source.slice() to copy the tail of a node after
rewriting its specifier, which skipped child nodes entirely. A nested
import('react') inside a type argument of a remapped specifier (e.g.
import('./App').Props<import('react').ReactNode>) was therefore left
unrewritten after migration.
Replace the raw slice with span(), which iterates child nodes through
emit() and rewrites them. This is safe for all callers: import/export
declarations and require() calls have no children in the tail range.1 parent 718665b commit 7bb3b74
2 files changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
769 | | - | |
| 769 | + | |
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
137 | 147 | | |
138 | 148 | | |
139 | 149 | | |
| |||
0 commit comments