<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
The most recent recent publish of <code class="notranslate">@babel/types</code> is not compiling with TypeScript. The error is <code class="notranslate">TS8020</code>, JSDoc types can only be used inside documentation comments.</p>
<p dir="auto"><strong>Input Code</strong></p>
<ul dir="auto">
<li><a href="https://github.com/o15y/staart/pulls">https://github.com/o15y/staart/pulls</a></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node_modules/@babel/types/lib/index.d.ts:2098:30 - error TS8020: JSDoc types can only be used inside documentation comments.
2098 export function isNode(node: ?object): boolean
                                  ~~~~~~~
node_modules/@babel/types/lib/index.d.ts:2100:52 - error TS8020: JSDoc types can only be used inside documentation comments.
2100 export function isPlaceholderType(placeholderType: ?string, targetType: string): boolean
                                                        ~~~~~~~
node_modules/@babel/types/lib/index.d.ts:2104:34 - error TS8020: JSDoc types can only be used inside documentation comments.
2104 export function isType(nodetype: ?string, targetType: string): boolean
                                      ~~~~~~~
Found 3 errors."><pre class="notranslate"><code class="notranslate">node_modules/@babel/types/lib/index.d.ts:2098:30 - error TS8020: JSDoc types can only be used inside documentation comments.
2098 export function isNode(node: ?object): boolean
                                  ~~~~~~~
node_modules/@babel/types/lib/index.d.ts:2100:52 - error TS8020: JSDoc types can only be used inside documentation comments.
2100 export function isPlaceholderType(placeholderType: ?string, targetType: string): boolean
                                                        ~~~~~~~
node_modules/@babel/types/lib/index.d.ts:2104:34 - error TS8020: JSDoc types can only be used inside documentation comments.
2104 export function isType(nodetype: ?string, targetType: string): boolean
                                      ~~~~~~~
Found 3 errors.
</code></pre></div>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ babel ./test.js --no-babelrc --presets=module:@babel/preset-react --plugins=module:@babel/plugin-transform-regenerator
TypeError: /Users/stevefar/sc/labeltron/test.js: Duplicate declaration &quot;newSessionId&quot; (This is an error on an internal node. Probably an internal error.)
    at File.buildCodeFrameError (/Users/stevefar/sc/labeltron/node_modules/@babel/core/lib/transformation/file/file.js:259:12)
    at Scope.checkBlockScopedCollisions (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:347:22)
    at Scope.registerBinding (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:504:16)
    at Scope.registerDeclaration (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:444:14)
    at Object.Declaration (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:125:12)
    at NodePath._call (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitMultiple (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/context.js:85:17)"><pre class="notranslate"><code class="notranslate">$ babel ./test.js --no-babelrc --presets=module:@babel/preset-react --plugins=module:@babel/plugin-transform-regenerator
TypeError: /Users/stevefar/sc/labeltron/test.js: Duplicate declaration "newSessionId" (This is an error on an internal node. Probably an internal error.)
    at File.buildCodeFrameError (/Users/stevefar/sc/labeltron/node_modules/@babel/core/lib/transformation/file/file.js:259:12)
    at Scope.checkBlockScopedCollisions (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:347:22)
    at Scope.registerBinding (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:504:16)
    at Scope.registerDeclaration (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:444:14)
    at Object.Declaration (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/scope/index.js:125:12)
    at NodePath._call (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/path/context.js:88:12)
    at TraversalContext.visitQueue (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/context.js:118:16)
    at TraversalContext.visitMultiple (/Users/stevefar/sc/labeltron/node_modules/@babel/traverse/lib/context.js:85:17)
</code></pre></div>
<p dir="auto"><strong>Input Code</strong><br>
The is the contents of test.js</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;Component&gt;
  {() =&gt; {
    const saveSession = async () =&gt; {
      const newSessionId = await someAsyncFunc();
    };
  }}
&lt;/Component&gt;;
"><pre class="notranslate"><span class="pl-c1">&lt;</span><span class="pl-ent">Component</span><span class="pl-c1">&gt;</span>
  <span class="pl-kos">{</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">const</span> <span class="pl-en">saveSession</span> <span class="pl-c1">=</span> <span class="pl-k">async</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">const</span> <span class="pl-s1">newSessionId</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">someAsyncFunc</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>
  <span class="pl-kos">}</span><span class="pl-kos">}</span>
<span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">Component</span><span class="pl-c1">&gt;</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
I get a runtime error running <code class="notranslate">babel</code>, I expected it to create the transpiled code.</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<p dir="auto">babel ./test.js --no-babelrc --presets=module:@babel/preset-react --plugins=module:@babel/plugin-transform-regenerator</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.0.0-rc.2 (@babel/core 7.0.0-rc.2)</li>
<li>Node/npm version: Node 8/npm 5</li>
<li>OS: OSX 10.13.6</li>
<li>Monorepo no</li>
<li>How you are using Babel: cli</li>
</ul>
<p dir="auto"><strong>Additional context/Screenshots</strong><br>
If I do each transform as a individual step it works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cat ./test.js | babel --no-babelrc --presets=module:@babel/preset-react | babel --no-babelrc --plugins=module:@babel/plugin-transform-regenerator
"><pre class="notranslate"><code class="notranslate">$ cat ./test.js | babel --no-babelrc --presets=module:@babel/preset-react | babel --no-babelrc --plugins=module:@babel/plugin-transform-regenerator

</code></pre></div>
<p dir="auto">Its not clear why this would work, but including both the preset and plugin would not.</p>