• Stars
    star
    204
  • Rank 188,298 (Top 4 %)
  • Language
  • License
    MIT License
  • Created over 8 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JS Refactoring tool for Visual Studio Code

JS Refactor :: JS CodeFormer

JS Refactor has been retired. This project is now an extension installer for its replacement, JS CodeFormer. If you install this extension, you will get that one.

You can install JS CodeFormer directly:

https://marketplace.visualstudio.com/items?itemName=cmstead.js-codeformer

The Good News/Bad News Situation

The good news, this project will install JS CodeFormer for you, and you will get nearly the same hotkeys you've developed muscle memory for. The bad news, this is not the old project.

More good news: JS CodeFormer is a significant improvement in a number of ways:

  • It's faster -- a LOT faster. In just about every way.
  • It has a broader language footprint -- JSR at its best supported standard JavaScript and some TypeScript if it wasn't too fancy. JS CodeFormer can parse and interpret a large number of languages and framework-specific file formats, including JS/TS embedded in HTML and HTML-like files.
  • It's designed for stability and maintenance -- The source code is well tested, and designed for quick easy fixes, which has already borne fruit.
  • The old JSR bugs are gone -- I combed through the old issues and either verified they were gone, or fixed them if they were a design oversight.

The Highlights

Language Support

Languages:

  • JavaScript
  • TypeScript
  • HTML (Embedded Javascript)

Frameworks:

  • Angular
  • React
  • Vue

Framework-specific formats:

Experimental framework support:

Refactorings

  • Extract Method/Function
    • Windows: ctrl+shift+j, m
    • Mac: cmd+shift+j, m
  • Extract to Parameter
    • Windows: ctrl+shift+j, p
    • Mac: cmd+shift+j, p
  • Extract Variable
    • Windows: ctrl+shift+j, v
    • Mac: cmd+shift+j, v
  • Inline Variable
    • Windows: ctrl+shift+j, i
    • Mac: cmd+shift+j, i
  • Rename (important for non js/ts files)
    • Windows: ctrl+shift+j, r
    • Mac: cmd+shift+j, r

Conversions

  • Change Variable Type
  • Convert Expression to Template Literal
  • Convert Function to Arrow Function
  • Convert Function to Function Expression
  • Convert Function Property to Method
  • Convert Function Variable to Function Declaration
  • Toggle Property Declaration Type

Other Actions

  • Surround with (open options list)
    • Windows: ctrl+shift+j, w
    • Mac: cmd+shift+j, w
  • Introduce variable
  • Introduce function
  • Lift and name function expression

Why (The Life Story)

JS Refactor was created at a time when VS Code was new and the refactoring landscape in the editor was limited. It was initially designed to simply be a refactoring extension. As time went along, it grew, and extended beyond being a simple refactoring tool.

Meanwhile the codebase was increasingly difficult to maintain. It was the first extension I authored for VS Code, and, even with significant work to improve the codebase, the problems were built too deeply into the core.

Eventually JS Refactor broke and I didn't have the energy to deal with the fallout anymore. I stopped most work for almost 2 full years. Once I resurfaced, I realized the only way out was to replace the original and build a system around certain principles which would lead to software which would work reliably, and could be maintained at a sustainable pace.

I started work on JS CodeFormer. Now that JS CodeFormer is in a stable initial state, it is time to give JS Refactor an honorable send-off. Instead of leaving a project to languish, it made more sense to send people where they can get something arguably better. This led me to the state of the software you see today.

Thank you to everyone who joined me on the initial journey. I hope you all will come and join me as we build better software together!

More Repositories

1

js-codeformer

A JS refactoring and code automation tool for building better source
JavaScript
23
star
2

becoming-a-js-developer

Resources, cheat sheets, tools and things which I kind of wish I had when I was starting out.
JavaScript
21
star
3

JFP

Javascript functional programming utilities borrowed heavily against Lisp.
JavaScript
20
star
4

sky-clock

A simple clock for displaying time and events for Sky: Children of the Light
JavaScript
16
star
5

jsLearnerForms

Javascript forms for developing muscle memory
JavaScript
13
star
6

quokka-signet-explorer

Quokka plugin for exploring API endpoints to identify function signatures
JavaScript
8
star
7

js-refactor-atom

JS Refactoring tool suite for the Atom editor
JavaScript
5
star
8

signet

A function type signature library for Javascript
JavaScript
5
star
9

programming-cheat-sheets

A vocabulary list for people learning programming with Javascript
5
star
10

quokka-prerun

Quokka plugin to run module prerun scripts
JavaScript
4
star
11

tstraverse

A Typescript AST traversal tool for making static analysis tools easier to build
JavaScript
3
star
12

phcollect

PHP Collections Library
PHP
3
star
13

nanocommit

Commit every time your tests pass, no fuss, no muss
JavaScript
2
star
14

scotl-emote-bot

SCOTL Emote Discord Bot
JavaScript
2
star
15

bad-voting-machine

An online voting machine to raise awareness about voting machine bugs and insecurities
JavaScript
2
star
16

DataMother.js

DataMother is/will be a test data management tool for unit testing JS.
JavaScript
2
star
17

pretty-object

A utility for producing a simple string representation of an object in C#
C#
2
star
18

booklisp

A small, extremely limited lisp-like DSL for book content embedding written in Javascript
JavaScript
2
star
19

jslogger

Javascript console abstraction - Keeps logging to a minimum in a production environment
JavaScript
2
star
20

tdd-workshop

Resources for my TDD workshop
JavaScript
1
star
21

fchurn

File churn metric generator for projects using Git
JavaScript
1
star
22

Mocular

A service mocking library for Angular testing
JavaScript
1
star
23

snipkit

A snippet editing tool for VS Code
JavaScript
1
star
24

dject-cli

CLI tooling for setting up and using the Dject DI system
JavaScript
1
star
25

jsioc

A flexible IoC container for Javascript
JavaScript
1
star
26

globMatcher

Performs pattern matches on strings using glob-style patterns
JavaScript
1
star
27

quokka-mocha-bdd

Quokka plugin to run Mocha tests with the BDD style interface
JavaScript
1
star
28

microrefactorings

Microrefactorings: The Language of Changing Code
1
star
29

unit-testing

Unit testing informational examples and walkthroughs
JavaScript
1
star
30

minos

Simple, extensible rich data validation and integrity checker for Javascript
JavaScript
1
star
31

jqreactive

A "see-through" application framework for people to learn about web frameworks and reactive development
JavaScript
1
star
32

IoJson

JSON parser and serializer implementation in Io
Io
1
star
33

kin-js

Kin.js is an object inheritance, composition and reflection library
JavaScript
1
star
34

explore-tdd-in-js

Explorations of TDD in Javascript - Source to accompany video(s)
JavaScript
1
star
35

gittey

Customize your Git workflow.
JavaScript
1
star
36

microJ

A slim and trim, essentials-only version of JFP
JavaScript
1
star
37

python-automation

Cookiecutter templates, and VS Code snippets to reduce the stuff I must remember to do
Python
1
star
38

fsf-temp

This is a temp repo for the Utah virtual class!
1
star
39

string-parser-example

String parsing function example, TDD, microcommitted
JavaScript
1
star
40

ClickBeetleJS

A full-featured, modern menu script built from the perspective of accessibility first.
JavaScript
1
star
41

matchlight

A rich pattern matching library to light up your code
JavaScript
1
star
42

articulate-js

An extension to refocus JS development around talking about logic instead of raw code
JavaScript
1
star
43

coding-joyfully

A book on the art of mindful software development
1
star
44

quokka-mocha-approvals-helper

A helper package for running approvals in the Quokka runtime environment
JavaScript
1
star
45

Modella

Modella is a data modelling and request abstraction layer for data-rich javascript applications.
JavaScript
1
star
46

resume

My JSON resume
HTML
1
star