Use the Context object in transformations
mainThe Context object is passed to your ASTTransformation and contains the tools required to inspect and modify the code:
root: The parsed AST root (returned byjscodeshift'sCore).j: ThejscodeshiftAPI instance used for creating, finding, and manipulating AST nodes.filename: The path/name of the file currently being processed.
export type Context = {
root: ReturnType<Core>
j: JSCodeshift
filename: string
}