cmstead / js-codeformer

A JS refactoring and code automation tool for building better source
MIT License
27 stars 2 forks source link

Return to variable with extract method #13

Closed cmstead closed 3 years ago

cmstead commented 3 years ago

When extracting a method,

When the last line is a variable declaration

Then:

  1. convert the variable declaration to a return statement
  2. create a variable assignment for the method call
  3. ensure variable type matches declaration from new function body
cmstead commented 3 years ago

Complete and available in the latest release:

https://github.com/cmstead/js-codeformer/releases/tag/v1.1.0