facebook/jscodeshift ? reverse-engineered prompt

Reverse engineered prompt

Build me a JavaScript codemod tool that can run a transform across many JavaScript and TypeScript files from the command line.

I want to point it at a transform file and a set of paths, then have it process each file, show a summary of what changed, and support a dry run where it only prints results. It should also expose a simple programmatic API so I can run the same thing from Node code.

The transform should receive the file contents, let me inspect and edit the code as an AST, and then return the updated source. It should try hard to keep the original formatting and comments intact when writing changes back.

Please include support for common parser options like JavaScript, TypeScript, Flow, and JSX, plus a way for transforms to report stats and messages while they run. If you need to check current docs or parser behavior online, go ahead and look it up.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab