<p dir="auto">Compare this <a href="https://babeljs.io/repl/#?experimental=true&amp;evaluate=true&amp;loose=false&amp;spec=false&amp;code=function%20f%20()%7B%0A%20%20%2F%2F%20comment%20here%0A%20%20var%20f%0A%7D" rel="nofollow">https://babeljs.io/repl/#?experimental=true&amp;evaluate=true&amp;loose=false&amp;spec=false&amp;code=function%20f%20()%7B%0A%20%20%2F%2F%20comment%20here%0A%20%20var%20f%0A%7D</a></p>
<p dir="auto">to this <a href="https://babeljs.io/repl/#?experimental=true&amp;evaluate=true&amp;loose=false&amp;spec=false&amp;code=function%20f%20()%7B%0A%20%20%2F%2F%20comment%20here%0A%7D" rel="nofollow">https://babeljs.io/repl/#?experimental=true&amp;evaluate=true&amp;loose=false&amp;spec=false&amp;code=function%20f%20()%7B%0A%20%20%2F%2F%20comment%20here%0A%7D</a></p>
<p dir="auto">Is there any reason for this behaviour? I used this trick <a href="https://github.com/ractivejs/ractive/blob/db7a5d61730ad72857ae355597838b3d77f5bc28/src/utils/log.js#L21">https://github.com/ractivejs/ractive/blob/db7a5d61730ad72857ae355597838b3d77f5bc28/src/utils/log.js#L21</a> and suddenly realised it doesn't work because of the issue. I managed to solve it by switching to a similar technique (unused variable), but this still looks like an inconsistency.</p>
<p dir="auto">This code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="try {
  foo();
} catch(e) {
  // do nothing
}"><pre class="notranslate"><span class="pl-k">try</span> <span class="pl-kos">{</span>
  <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">catch</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-c">// do nothing</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Compiles to this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

try {
  foo();
} catch (e) {}

// do nothing"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">try</span> <span class="pl-kos">{</span>
  <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>

<span class="pl-c">// do nothing</span></pre></div>
<p dir="auto">It's ok at all, except eslint. It's affecting <code class="notranslate">no-empty</code> rule.</p>