Rename / Move File or Folder
getEditsForFileRenameRenames or moves TypeScript/JavaScript files or folders and automatically updates all import paths across the project. Supports .ts, .tsx, .js, .jsx.
Instructions
Rename or move a TypeScript/JavaScript file OR folder and automatically update all import paths across the project. Supports .ts, .tsx, .js, .jsx. tsserver auto-discovers the relevant tsconfig.json. For folders, all imports referencing files inside the folder are updated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | New file or folder path (absolute or relative to cwd) | |
| from | Yes | Current file or folder path (absolute or relative to cwd) | |
| preview | Yes | If true, show what would change without applying anything |