<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
babel-core doesn't list which plugins/presets are duplicated:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   Duplicate plugin/preset detected.
    If you'd like to use two separate instances of a plugin,
    they need separate names, e.g.

      plugins: [
        ['some-plugin', {}],
        ['some-plugin', {}, 'some unique name'],
      ]

      at assertNoDuplicates (node_modules/@babel/core/lib/config/config-descriptors.js:205:13)
      at createDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
      at createPluginDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
      at alias (node_modules/@babel/core/lib/config/config-descriptors.js:63:49)
      at cachedFunction (node_modules/@babel/core/lib/config/caching.js:33:19)
      at plugins.plugins (node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
      at mergeChainOpts (node_modules/@babel/core/lib/config/config-chain.js:319:26)
      at node_modules/@babel/core/lib/config/config-chain.js:283:7
      at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:68:29)
      at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)"><pre class="notranslate"><code class="notranslate">   Duplicate plugin/preset detected.
    If you'd like to use two separate instances of a plugin,
    they need separate names, e.g.

      plugins: [
        ['some-plugin', {}],
        ['some-plugin', {}, 'some unique name'],
      ]

      at assertNoDuplicates (node_modules/@babel/core/lib/config/config-descriptors.js:205:13)
      at createDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
      at createPluginDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
      at alias (node_modules/@babel/core/lib/config/config-descriptors.js:63:49)
      at cachedFunction (node_modules/@babel/core/lib/config/caching.js:33:19)
      at plugins.plugins (node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
      at mergeChainOpts (node_modules/@babel/core/lib/config/config-chain.js:319:26)
      at node_modules/@babel/core/lib/config/config-chain.js:283:7
      at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:68:29)
      at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)
</code></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
A list of duplicate plugins/presets so that you know which ones to remove or rename.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  &quot;babel&quot;: {
    &quot;plugins&quot;: [
      &quot;@babel/plugin-proposal-class-properties&quot;,
      &quot;@babel/plugin-syntax-dynamic-import&quot;,
      &quot;@babel/plugin-transform-runtime&quot;,
      &quot;babel-plugin-istanbul&quot;,
      &quot;babel-plugin-styled-components&quot;,
      &quot;syntax-export-extensions&quot;
    ],
    &quot;presets&quot;: [
      [&quot;@babel/preset-env&quot;, {
        &quot;debug&quot;: true
      }],
      [&quot;@babel/preset-react&quot;, { &quot;debug&quot;:  true }]
    ]
  },"><pre class="notranslate">  <span class="pl-ent">"babel"</span>: {
    <span class="pl-ent">"plugins"</span>: [
      <span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-proposal-class-properties<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-syntax-dynamic-import<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-transform-runtime<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>babel-plugin-istanbul<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>babel-plugin-styled-components<span class="pl-pds">"</span></span>,
      <span class="pl-s"><span class="pl-pds">"</span>syntax-export-extensions<span class="pl-pds">"</span></span>
    ],
    <span class="pl-ent">"presets"</span>: [
      [<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-env<span class="pl-pds">"</span></span>, {
        <span class="pl-ent">"debug"</span>: <span class="pl-c1">true</span>
      }],
      [<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-react<span class="pl-pds">"</span></span>, { <span class="pl-ent">"debug"</span>:  <span class="pl-c1">true</span> }]
    ]
  },</pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.4.0</li>
<li>Node/npm version: Node 10/npm 6</li>
<li>OS: macOS 10.14.3</li>
</ul>
<p dir="auto">Bug report</p>

<h3 dir="auto">Input Code</h3>


<p dir="auto">The following will build without error in Babel:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const fn = () =&gt; {
  if (x) return x
  let x = true
}

fn() // ReferenceError: x is not defined"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">fn</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span> <span class="pl-k">return</span> <span class="pl-s1">x</span>
  <span class="pl-k">let</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span>
<span class="pl-kos">}</span>

<span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// ReferenceError: x is not defined</span></pre></div>
<p dir="auto">However, when ES6 transform is applied, the <code class="notranslate">let</code> declaration transpiles into a <code class="notranslate">var</code>, which is hoisted and run without error</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var fn = function fn() {
  if (x) return;
  var x = true;
};

fn(); // OK"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-en">fn</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span> <span class="pl-k">return</span><span class="pl-kos">;</span>
  <span class="pl-k">var</span> <span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-en">fn</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// OK</span></pre></div>
<h3 dir="auto">Babel/Babylon Configuration (.babelrc, package.json, cli command)</h3>

<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [
    [&quot;babel-preset-env&quot;, {
      &quot;targets&quot;: {
        &quot;browsers&quot;: [&quot;last 2 Chrome versions&quot;],
        &quot;uglify&quot;: true
      }
    }]
  ]
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">[</span><span class="pl-s">"babel-preset-env"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
      <span class="pl-s">"targets"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"browsers"</span>: <span class="pl-kos">[</span><span class="pl-s">"last 2 Chrome versions"</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
        <span class="pl-s">"uglify"</span>: <span class="pl-c1">true</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>
<h3 dir="auto">Expected Behavior</h3>


<p dir="auto">I would expect Babel to warn me that my un-transpiled code would have caused an error, but the transpiled code prevents that error.</p>
<h3 dir="auto">Current Behavior</h3>


<p dir="auto">I can introduce a bug in my code without realizing it, because the transpiled version fixes said bug.</p>
<h3 dir="auto">Possible Solution</h3>


<h3 dir="auto">Context</h3>


<p dir="auto">I actually removed the <code class="notranslate">uglify</code> option from my Babel configuration because I did not want to transpile everything into ES5 syntax. Suddenly, I was getting a <code class="notranslate">ReferenceError</code> in my code that previously worked fine.</p>
<h3 dir="auto">Your Environment</h3>

<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>6.26.0</td>
</tr>
<tr>
<td>Babylon</td>
<td></td>
</tr>
<tr>
<td>node</td>
<td>8.11.1</td>
</tr>
<tr>
<td>npm</td>
<td>5.6.0</td>
</tr>
<tr>
<td>Operating System</td>
<td>High Sierra</td>
</tr>
</tbody>
</table>