jscodeshift has around 25 APIs to help developers easily detect and transform any JS/TS code.
Generally, creating a codemod involves two main tasks: detection and transformation.
For jscodeshift, we have a set of APIs for each part of the codemod process (initial traversal, filtering, transformation), as detailed below. jscodeshift accepts —parser
as argument. We can select from the list of parser that are currently supported, all those parsers should be compatible with estree
spec and have same AST grammar. It's important to know the AST grammar for describing the nodes in the codemod.
Refer to this link for ES5, and this link for babel-parser AST node definitions.