<p dir="auto">I don't know if the following is a compiler bug, or simply bad ES6 syntax:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let makeSate = (name, params, path) =&gt; {name, params, path}"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-en">makeSate</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">,</span> <span class="pl-s1">path</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">,</span> <span class="pl-s1">path</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">Is transpiled to</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="makeState = function makeState(name, params, path) {
    name, params, path;
};"><pre class="notranslate"><span class="pl-en">makeState</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">makeState</span><span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">,</span> <span class="pl-s1">path</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">,</span> <span class="pl-s1">path</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">And I need to write this</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let makeSate = (name, params, path) =&gt; { return {name, params, path} }"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-en">makeSate</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">,</span> <span class="pl-s1">path</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-kos">{</span>name<span class="pl-kos">,</span> params<span class="pl-kos">,</span> path<span class="pl-kos">}</span> <span class="pl-kos">}</span></pre></div>
<p dir="auto">To get the result I want</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="makeState = function makeState(name, params, path) {
    return { name: name, params: params, path: path };
};"><pre class="notranslate"><span class="pl-en">makeState</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">makeState</span><span class="pl-kos">(</span><span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-s1">params</span><span class="pl-kos">,</span> <span class="pl-s1">path</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s1">name</span><span class="pl-kos">,</span> <span class="pl-c1">params</span>: <span class="pl-s1">params</span><span class="pl-kos">,</span> <span class="pl-c1">path</span>: <span class="pl-s1">path</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I noticed that Babel doesn't seem to support returning an object from an arrow function.  For example, I am trying to write a function that compiled to this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var objects = [1, 2, 3].map(function (item) {
  return { 'number': item };
});"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">objects</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">item</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">return</span> <span class="pl-kos">{</span> <span class="pl-s">'number'</span>: <span class="pl-s1">item</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">So, I wrote a one-liner using an Arrow function and the implicit return like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const objects = [1, 2, 3].map((item) =&gt; { 'number': item });"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">objects</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">item</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-s">'number'</span>: <span class="pl-s1">item</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">However, the above ES6 code above compiles to the following:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var objects = [1, 2, 3].map(function (item) {
  number: item;
});"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">objects</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">item</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  number: <span class="pl-s1">item</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">and thus, <code class="notranslate">objects</code> has three <code class="notranslate">null</code>s in it.  I understand that the curly braces are probably confusing to the compiler, but is it possible that this could be supported eventually?</p>