0.0.2 • Published 8 years ago

babel-plugin-transform-implicit-return v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

babel-plugin-transform-implicit-return

Functions that returns implicitly, like Ruby methods:

function someFunction() {
  'implicitReturn';

  123;
}

...is transformed to:

function someFunction() {
  return 123;
}

Arrow functions with a {} block are transfored too.

Functions without the implicitReturn directive are not transformed.

Why?

It’s useful to create powerful REPLs.