Skip to content
CodeMorph
Esc
  • No results for ""

Review and accept diffs

Every converted file arrives as a side-by-side diff. Accept it, reject it, or ask Morph why before you decide.

CodeMorph's rule is simple: nothing is written to your project without your approval. Every converted file becomes a diff, and you decide what lands.

Reviewing a JavaScript to TypeScript diff

How review works

  1. Work happens on a branch. The migration runs on its own branch, shown in the title bar (for example codemorph/js-to-ts), so your main branch stays untouched until you merge.
  2. Each file opens as a diff. Your JavaScript on the left, the TypeScript on the right, with additions highlighted.
  3. Morph explains the change. The panel summarizes what it did, for example cart.ts: inferred CartItem and Cart from 14 call sites. Typecheck passes with strict mode.
  4. Accept or reject. Accept keeps the file. Reject restores the original. A short confirmation names the file and the next one in line, such as cart.ts accepted · next: orders.ts.

File states

The Morph panel lists every file in the current run with its state:

StateMeaning
acceptedYou approved it. The TypeScript version is in your working tree.
reviewConverted and waiting for your decision.
queuedNot converted yet.

What a good diff looks like

A migration diff should be boring. Expect to see:

  • .js renamed to .ts, or .jsx to .tsx.
  • Parameter and return types added from real usage.
  • interface or type declarations for objects that cross module boundaries.
  • require() and module.exports converted to import and export where it's safe.

What you shouldn't see is logic changes. Conversions are meant to preserve behavior exactly, and Verify runs your tests and build to check that they do.

Ask before you accept

Not sure why a parameter became string | undefined? Open the Ask tab and ask. Morph knows every change it made and why, and answers with the call sites that drove the decision, for example orders.ts:42.

Files that need you

If a file can't pass tsc after a few repair attempts, CodeMorph won't force it through with any. It leaves the file in review with the remaining diagnostics, so you can fix it by hand or ask Morph for help.

Committing

Accepted files are ordinary changes in your working tree. Review them in Source Control (Ctrl Shift G) and commit the way you always do.

Something unclear or out of date? Tell us.