I have a CallExpression like myFunc(param1, param2, insert_here_param_3); how to insert a param like that at the last place in of a function? Sinc ...
I have a CallExpression like myFunc(param1, param2, insert_here_param_3); how to insert a param like that at the last place in of a function? Sinc ...
I'm just getting started with writing CodeMods with jscodeshift. I noticed that the find method seems to always return a Collection. If there is only ...
I am new to jscodeshift and I'm using it to transform existing code, I have achieved almost everything but I am stuck at a part where I need to transf ...
I recently have spotted jscodeshift and leveraging it for refactoring. But I can't find a way to add await before the node that I am seeking. This ...
okay so I have code that looks like this: import { wait } from "@testing-library/react"; describe("MyTest", () => { it("should wait", async () ...
Im trying to use jscodeshift but when I say directory to /src it doesn't recurse correctly. For example: When trying ./src I get 4 files: If I try ...
Hi I'm trying to write a codemod which moves my require statement from top of the file to inside class constructor function. These require statemen ...
Given the code snippet, including a simple tsx string of a React component: // test.ts import j from "jscodeshift"; const code = ` cons ...
I'm new to jscodeshift and AST but I'm trying to do a conversion for my existing forEach loops and convert them to regular for loops. I want to cover ...
I'm working on a small project and I need to remove a specific component from a tree without removing its children. Let's imagine the following code: ...
I'm very new to jscodeshift. Goal: I'm trying to build a codemod that does the following: Remove old import -> DONE Add new Import -> DON ...
I have this AST explorer snippet which almost lets me do what I want, which is to turn this: function bar() {return 42;} var baz = {} import 'get-out ...
How to get what is the typeof of variable in AST? I want to find the variables that are typeof globalThis. (for example baz is typeof globalThis) ...
I want to parse this code to ast: But when I run I get error: This is the full code: In astexplorer.net it is works. How make it work in code ...
I'm trying run jscodeshift against an old react applications. I'm getting the error below. error ERR app/assets/javascripts/components/api_errors/e ...
I'm currently trying to write a codemod that will remove all the $ReadOnly<T> generic from a TypeScript codebase, keeping only T (T being an obj ...
I am completely new to backend react setups. Everything was going well until I started styling...I got this Upon googling, I landed on the jscodes ...
I'm trying to run the top-level-imports codemod found here: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-codemod/README.md# ...
I get the following error when I run jscodeshift -t ./react-codemod/transforms/React-PropTypes-to-prop-types.js ./src I googled a bit and found out ...
Let's say I have the following file How can I transform this file using jscodeshift so it wraps the object into function like this: My main pro ...