https://github.com/mikaelbr/vscodemod
VSCode extension for doing codemod on selected text
https://github.com/mikaelbr/vscodemod
Last synced: 30 days ago
JSON representation
VSCode extension for doing codemod on selected text
- Host: GitHub
- URL: https://github.com/mikaelbr/vscodemod
- Owner: mikaelbr
- Created: 2017-09-22T21:49:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-03T22:04:57.000Z (over 7 years ago)
- Last Synced: 2025-03-01T06:51:12.688Z (about 2 months ago)
- Language: JavaScript
- Size: 1.01 MB
- Stars: 30
- Watchers: 8
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-codemods - vscodemod - VSCode extension for doing codemod on selected text. (Editor Plugins / ant-design)
README
# [WIP] vscodemod – Run codemod on selected code
VSCode Extension for doing JavaScript code modifications (AST to AST transformations) in VSCode using [jscodeshift](https://github.com/facebook/jscodeshift).
**Disclaimer**: Currently work in progress. Not all codemods are complete or take into account all cases, and they aren't tested. Any feedback, pull requests or issues are highly appriciated. Feel free to join in on the project by creating codemods and/or tests.
## Why?
I often find myself doing the same code transformations manually when coding: toggling between functions and classes (for React), between arrow functions and normal functions, arrow functions without explicit return to functions with explicit return, etc. All these types of transformations can be done automatically and safely by AST-transformation. This project tries to realise that – by collecting common transform tasks in a convenient VSCode extension.
## Usage

## Roadmap
- Support for custom codemods (reading from dir)
- More codemods.
- Dry-run preview?
- Integration with prettier if format on save?
- Smarter meny selection based on AST of selected code?