<h2 dir="auto">Bug Report</h2>

<p dir="auto"><strong>Current Behavior</strong><br>
cli option '--copy-files' copies all non-compiled files, including ignored files</p>
<p dir="auto"><strong>Input Code</strong></p>
<ul dir="auto">
<li>Not behave as what i expect</li>
</ul>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// package.json
{
  &quot;scripts&quot;: {
     &quot;build&quot;: &quot;babel src --out-dir dist --copy-files --ignore src/**/*.test.js  --presets=@babel/env&quot;
  }
}"><pre class="notranslate"><span class="pl-ii">// package.json</span>
{
  <span class="pl-ent">"scripts"</span>: {
     <span class="pl-ent">"build"</span>: <span class="pl-s"><span class="pl-pds">"</span>babel src --out-dir dist --copy-files --ignore src/**/*.test.js  --presets=@babel/env<span class="pl-pds">"</span></span>
  }
}</pre></div>
<p dir="auto">run in terminal</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ npm run build"><pre class="notranslate">$ npm run build</pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
'--copy-files' copies all non-compiled files, and skip ignored files</p>
<p dir="auto"><strong>Environment</strong></p>

<ul dir="auto">
<li>Babel version(s): [v7.7.4]</li>
<li>Node/npm version: [ Node v12.13]</li>
<li>OS: [OSX 10.15.1,]</li>
<li>How you are using Babel: [<code class="notranslate">cli</code>]</li>
</ul>
<h3 dir="auto"><g-emoji class="g-emoji" alias="computer" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4bb.png">💻</g-emoji></h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">Programmatic API (<code class="notranslate">babel.transform</code>, <code class="notranslate">babel.parse</code>)</p>
<h3 dir="auto">Input code</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// this &quot;A&quot; is an Interface
import { A } from './interface';

class A {}"><pre class="notranslate"><code class="notranslate">// this "A" is an Interface
import { A } from './interface';

class A {}
</code></pre></div>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Configuration</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">In babel, it throw TypeError: Duplicate declaration "A".<br>
But it compile success in typescript.</p>
<h3 dir="auto">Environment</h3>
<p dir="auto">@babel/core: 7.18.2</p>
<h3 dir="auto">Possible solution</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>