<h3 dir="auto">Input Code</h3>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let a: string = 'a';
(&lt;any&gt;a) = null;"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">a</span>: <span class="pl-smi">string</span> <span class="pl-c1">=</span> <span class="pl-s">'a'</span><span class="pl-kos">;</span>
<span class="pl-kos">(</span><span class="pl-kos">&lt;</span><span class="pl-smi">any</span><span class="pl-kos">&gt;</span><span class="pl-s1">a</span><span class="pl-kos">)</span> <span class="pl-c1">=</span> <span class="pl-c1">null</span><span class="pl-kos">;</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="{
  sourceType: 'module',
  plugins: [
    'typescript',
  ],
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-c1">sourceType</span>: <span class="pl-s">'module'</span><span class="pl-kos">,</span>
  <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
    <span class="pl-s">'typescript'</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">no error</p>
<h3 dir="auto">Current Behavior</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ERR ../main.ts Transformation error
SyntaxError: Invalid left-hand side in assignment expression (2:2)"><pre class="notranslate"><code class="notranslate"> ERR ../main.ts Transformation error
SyntaxError: Invalid left-hand side in assignment expression (2:2)
</code></pre></div>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">?</p>
<h3 dir="auto">Context</h3>
<p dir="auto">i need to parse typescript to codemod it using <a href="https://github.com/facebook/jscodeshift">jscodeshift</a> and <a href="https://github.com/benjamn/ast-types">ast-types</a>. it is already working, except for this error.</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>-</td>
</tr>
<tr>
<td>Babylon</td>
<td>7.0.0-beta.40</td>
</tr>
<tr>
<td>node</td>
<td>9.5.0</td>
</tr>
<tr>
<td>npm</td>
<td>5.7.1</td>
</tr>
<tr>
<td>Operating System</td>
<td>macOS 10.12.6</td>
</tr>
</tbody>
</table>
<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"> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">Other (Next.js, Gatsby, vue-cli, ...)</p>
<h3 dir="auto">Input code</h3>
<p dir="auto"><a href="https://codesandbox.io/s/bold-pond-g5nzv" rel="nofollow">https://codesandbox.io/s/bold-pond-g5nzv</a></p>
<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">If you will try to check example - you will notice that submenu items have collision with key names, however, if you will check what are expected assignment to this keys - they are no issue supposed to be. Moreover this code is working right now, but with different packages, mostly with 7.12.13, after I tried to re-generate my lock.yarn file - application gets broken.</p>
<p dir="auto">Expected behavior:<br>
Submenus in that particular case shouldn't have key's collision/duplication and as single-players.</p>
<p dir="auto">Current behavior:<br>
If you will expand any submenu - you will see warnings about duplicated keys also, if you will hover any sub-menu's item - they all will be highlighted, because of the same key value.</p>
<h3 dir="auto">Environment</h3>
<p dir="auto">Node 12</p>
<h3 dir="auto">Possible solution</h3>
<p dir="auto">Possibly it might be caused somewhere in between 7.12.13 and latest one</p>
<h3 dir="auto">Additional context</h3>
<p dir="auto">Tried this on on manual config and with react-scripts, after new installations (yarn re-generation as well) - code works with issue. If i compile my code with old yarn.lock file for manual config (based on 7.12.13) - everything works as expected.</p>