Write snippet code to rewrite your source code

Different than other linter tools (e.g. rubocop) or codemod tools (e.g. jscodeshift), synvert allows you to write snippet code to rewrite your source code.

Run snippet code

Synvert rewrites source code based on snippet code.
It provides many powerful APIs to write snippet code,
to find AST node, to check node
and to insert / delete / replace source code.

Snippet code demo 1
Generate snippet demo 1

Automatically generate snippet code

Synvert allows you to fill in some input code and expected output code,
then it can generate the snippet code automatically for you,
usually you can use the generated code to rewrite your source code.

Show diff view

Synvert GUI can show the diff view before rewriting,
so you can review the changes one by one,
then selectivly replace them.

Rewrite diff demo 1