Arrow functions implicit return
This plugin allows you to use arrow functions like do expressions.
Examples
const shows = "Death Note" "Steins;Gate" "Maho shojo XD";const nextShow = { const prevIndex = shows || 0; showsprevIndex + 1 % showslength;};
With JSX
const getUserNav = { <UserConsumer> { ifuser <span>Hello username!<span>; else <a onClick=showLogin>Login</a>; } </UserConsumer>};
Installation
npm install --save-dev babel-plugin-arrow-functions-implicit-return
Usage
.babelrc
(Recommended)
Via .babelrc
"plugins": "arrow-functions-implicit-return"
Via CLI
babel --plugins arrow-functions-implicit-return script.js
Via Node API
;