You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To view these docs locally, use `npx http-server ./docs`
510
514
515
+
## VSCode Debugging
516
+
517
+
It's recommended that you set up your codemod project to all debugging via the VSCode IDE. When you open your project in VSCode, add the following configuration to your launch.json debugging configuration.
518
+
519
+
```
520
+
{
521
+
// Use IntelliSense to learn about possible attributes.
522
+
// Hover to view descriptions of existing attributes.
523
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
1. Install evcodeshift as a package if you haven't done so already by running the command **npm install --save evcodeshift**. The debug configuration will not work otherwise.
587
+
2. Once the evcodeshift local package has been installed, go to the VSCode file tree and select the file on which you want to run the transform. For example, if you wanted to run codemod transforms of foo.js file, you would click on the entry for foo.js file in your project tree.
588
+
3. Select "Debug Transform" from the debugging menu's options menu.
589
+
4. Click the **"Start Debugging"** button on the VSCode debugger.
590
+
5. You will be then prompted for the name of evcodeshift transform file. Enter in the name of the transform file to use. If no name is given it will default to **transform.js**
591
+
6. Select the parser to use from the presented selection list of parsers. The transform will otherwise default to using the **babel** parser.
592
+
7. The transform will then be run, stopping at any breakpoints that have been set.
593
+
8. If there are no errors and the transform is complete, then the results of the transform will be printed in the VSCode debugging console. The file with the contents that have been transformed will not be changed, as the debug configuration makes use the evcodeshift **--dry** option.
0 commit comments