<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>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var [ x , x ] = [ 0 , , ] ;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-kos">[</span> <span class="pl-s1">x</span> <span class="pl-kos">,</span> <span class="pl-s1">x</span> <span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span> <span class="pl-c1">0</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">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"><code class="notranslate">x</code> is expected to be <code class="notranslate">undefined</code> but it is <code class="notranslate">0</code> in the transpiled code.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// transpiled code
&quot;use strict&quot;;

var x = 0,
  x;"><pre class="notranslate"><span class="pl-c">// transpiled code</span>
<span class="pl-s">"use strict"</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">0</span><span class="pl-kos">,</span>
  <span class="pl-s1">x</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Environment</h3>
<p dir="auto"><a href="https://babeljs.io/repl#?browsers=since%202105&amp;build=&amp;builtIns=false&amp;corejs=3.21&amp;spec=false&amp;loose=false&amp;code_lz=G4QwTgBA2hAeEBo4QLoQLzQgBkXtA3EA&amp;debug=false&amp;forceAllTransforms=false&amp;shippedProposals=false&amp;circleciRepo=&amp;evaluate=false&amp;fileSize=false&amp;timeTravel=false&amp;sourceType=module&amp;lineWrap=true&amp;presets=env%2Creact%2Cstage-2&amp;prettier=true&amp;targets=&amp;version=7.19.3&amp;externalPlugins=&amp;assumptions=%7B%7D" rel="nofollow">Reproduction on Babel's own REPL</a></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>
<p dir="auto">I followed the instructions for typescript on this page: <a href="https://babeljs.io/docs/en/babel-preset-typescript" rel="nofollow">https://babeljs.io/docs/en/babel-preset-typescript</a></p>
<p dir="auto">And ended up with a .babelrc file:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;presets&quot;: [&quot;@babel/preset-typescript&quot;],
    &quot;isTSX&quot;: true,
    &quot;allExtensions&quot;: true
}"><pre class="notranslate">{
    <span class="pl-ent">"presets"</span>: [<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-typescript<span class="pl-pds">"</span></span>],
    <span class="pl-ent">"isTSX"</span>: <span class="pl-c1">true</span>,
    <span class="pl-ent">"allExtensions"</span>: <span class="pl-c1">true</span>
}</pre></div>
<p dir="auto">babel setup (inside gatsby):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="─ @babel/cli@7.4.4
├─ @babel/code-frame@7.0.0
├─ @babel/core@7.4.5
├─ @babel/generator@7.4.4
├─ @babel/helper-annotate-as-pure@7.0.0
├─ @babel/helper-builder-binary-assignment-operator-visitor@7.1.0
├─ @babel/helper-builder-react-jsx@7.3.0
├─ @babel/helper-call-delegate@7.4.4
├─ @babel/helper-create-class-features-plugin@7.4.4
├─ @babel/helper-define-map@7.4.4
├─ @babel/helper-explode-assignable-expression@7.1.0
├─ @babel/helper-function-name@7.1.0
├─ @babel/helper-get-function-arity@7.0.0
├─ @babel/helper-hoist-variables@7.4.4
├─ @babel/helper-member-expression-to-functions@7.0.0
├─ @babel/helper-module-imports@7.0.0
├─ @babel/helper-module-transforms@7.4.4
├─ @babel/helper-optimise-call-expression@7.0.0
├─ @babel/helper-plugin-utils@7.0.0
├─ @babel/helper-regex@7.4.4
├─ @babel/helper-remap-async-to-generator@7.1.0
├─ @babel/helper-replace-supers@7.4.4
├─ @babel/helper-simple-access@7.1.0
├─ @babel/helper-split-export-declaration@7.4.4
├─ @babel/helper-wrap-function@7.2.0
├─ @babel/helpers@7.4.4
├─ @babel/highlight@7.0.0
├─ @babel/node@7.4.5
├─ @babel/parser@7.4.5
├─ @babel/plugin-proposal-async-generator-functions@7.2.0
├─ @babel/plugin-proposal-class-properties@7.4.4
├─ @babel/plugin-proposal-json-strings@7.2.0
├─ @babel/plugin-proposal-object-rest-spread@7.4.4
├─ @babel/plugin-proposal-optional-catch-binding@7.2.0
├─ @babel/plugin-proposal-unicode-property-regex@7.4.4
├─ @babel/plugin-syntax-async-generators@7.2.0
├─ @babel/plugin-syntax-class-properties@7.2.0
├─ @babel/plugin-syntax-dynamic-import@7.2.0
├─ @babel/plugin-syntax-flow@7.2.0
├─ @babel/plugin-syntax-json-strings@7.2.0
├─ @babel/plugin-syntax-jsx@7.2.0
├─ @babel/plugin-syntax-object-rest-spread@7.2.0
├─ @babel/plugin-syntax-optional-catch-binding@7.2.0
├─ @babel/plugin-syntax-typescript@7.3.3
├─ @babel/plugin-transform-arrow-functions@7.2.0
├─ @babel/plugin-transform-async-to-generator@7.4.4
├─ @babel/plugin-transform-block-scoped-functions@7.2.0
├─ @babel/plugin-transform-block-scoping@7.4.4
├─ @babel/plugin-transform-classes@7.4.4
├─ @babel/plugin-transform-computed-properties@7.2.0
├─ @babel/plugin-transform-destructuring@7.4.4
├─ @babel/plugin-transform-dotall-regex@7.4.4
├─ @babel/plugin-transform-duplicate-keys@7.2.0
├─ @babel/plugin-transform-exponentiation-operator@7.2.0
├─ @babel/plugin-transform-flow-strip-types@7.4.4
├─ @babel/plugin-transform-for-of@7.4.4
├─ @babel/plugin-transform-function-name@7.4.4
├─ @babel/plugin-transform-literals@7.2.0
├─ @babel/plugin-transform-member-expression-literals@7.2.0
├─ @babel/plugin-transform-modules-amd@7.2.0
├─ @babel/plugin-transform-modules-commonjs@7.4.4
├─ @babel/plugin-transform-modules-systemjs@7.4.4
├─ @babel/plugin-transform-modules-umd@7.2.0
├─ @babel/plugin-transform-named-capturing-groups-regex@7.4.5
├─ @babel/plugin-transform-new-target@7.4.4
├─ @babel/plugin-transform-object-super@7.2.0
├─ @babel/plugin-transform-parameters@7.4.4
├─ @babel/plugin-transform-property-literals@7.2.0
├─ @babel/plugin-transform-react-display-name@7.2.0
├─ @babel/plugin-transform-react-jsx-self@7.2.0
├─ @babel/plugin-transform-react-jsx-source@7.2.0
├─ @babel/plugin-transform-react-jsx@7.3.0
├─ @babel/plugin-transform-regenerator@7.4.5
├─ @babel/plugin-transform-reserved-words@7.2.0
├─ @babel/plugin-transform-runtime@7.4.4
├─ @babel/plugin-transform-shorthand-properties@7.2.0
├─ @babel/plugin-transform-spread@7.2.2
├─ @babel/plugin-transform-sticky-regex@7.2.0
├─ @babel/plugin-transform-template-literals@7.4.4
├─ @babel/plugin-transform-typeof-symbol@7.2.0
├─ @babel/plugin-transform-typescript@7.4.5
├─ @babel/plugin-transform-unicode-regex@7.4.4
├─ @babel/polyfill@7.4.4
├─ @babel/preset-env@7.4.5
├─ @babel/preset-react@7.0.0
├─ @babel/preset-typescript@7.3.3
├─ @babel/register@7.4.4
├─ @babel/runtime@7.4.5
├─ @babel/template@7.4.4
├─ @babel/traverse@7.4.5
└─ @babel/types@7.4.4"><pre class="notranslate"><code class="notranslate">─ @babel/cli@7.4.4
├─ @babel/code-frame@7.0.0
├─ @babel/core@7.4.5
├─ @babel/generator@7.4.4
├─ @babel/helper-annotate-as-pure@7.0.0
├─ @babel/helper-builder-binary-assignment-operator-visitor@7.1.0
├─ @babel/helper-builder-react-jsx@7.3.0
├─ @babel/helper-call-delegate@7.4.4
├─ @babel/helper-create-class-features-plugin@7.4.4
├─ @babel/helper-define-map@7.4.4
├─ @babel/helper-explode-assignable-expression@7.1.0
├─ @babel/helper-function-name@7.1.0
├─ @babel/helper-get-function-arity@7.0.0
├─ @babel/helper-hoist-variables@7.4.4
├─ @babel/helper-member-expression-to-functions@7.0.0
├─ @babel/helper-module-imports@7.0.0
├─ @babel/helper-module-transforms@7.4.4
├─ @babel/helper-optimise-call-expression@7.0.0
├─ @babel/helper-plugin-utils@7.0.0
├─ @babel/helper-regex@7.4.4
├─ @babel/helper-remap-async-to-generator@7.1.0
├─ @babel/helper-replace-supers@7.4.4
├─ @babel/helper-simple-access@7.1.0
├─ @babel/helper-split-export-declaration@7.4.4
├─ @babel/helper-wrap-function@7.2.0
├─ @babel/helpers@7.4.4
├─ @babel/highlight@7.0.0
├─ @babel/node@7.4.5
├─ @babel/parser@7.4.5
├─ @babel/plugin-proposal-async-generator-functions@7.2.0
├─ @babel/plugin-proposal-class-properties@7.4.4
├─ @babel/plugin-proposal-json-strings@7.2.0
├─ @babel/plugin-proposal-object-rest-spread@7.4.4
├─ @babel/plugin-proposal-optional-catch-binding@7.2.0
├─ @babel/plugin-proposal-unicode-property-regex@7.4.4
├─ @babel/plugin-syntax-async-generators@7.2.0
├─ @babel/plugin-syntax-class-properties@7.2.0
├─ @babel/plugin-syntax-dynamic-import@7.2.0
├─ @babel/plugin-syntax-flow@7.2.0
├─ @babel/plugin-syntax-json-strings@7.2.0
├─ @babel/plugin-syntax-jsx@7.2.0
├─ @babel/plugin-syntax-object-rest-spread@7.2.0
├─ @babel/plugin-syntax-optional-catch-binding@7.2.0
├─ @babel/plugin-syntax-typescript@7.3.3
├─ @babel/plugin-transform-arrow-functions@7.2.0
├─ @babel/plugin-transform-async-to-generator@7.4.4
├─ @babel/plugin-transform-block-scoped-functions@7.2.0
├─ @babel/plugin-transform-block-scoping@7.4.4
├─ @babel/plugin-transform-classes@7.4.4
├─ @babel/plugin-transform-computed-properties@7.2.0
├─ @babel/plugin-transform-destructuring@7.4.4
├─ @babel/plugin-transform-dotall-regex@7.4.4
├─ @babel/plugin-transform-duplicate-keys@7.2.0
├─ @babel/plugin-transform-exponentiation-operator@7.2.0
├─ @babel/plugin-transform-flow-strip-types@7.4.4
├─ @babel/plugin-transform-for-of@7.4.4
├─ @babel/plugin-transform-function-name@7.4.4
├─ @babel/plugin-transform-literals@7.2.0
├─ @babel/plugin-transform-member-expression-literals@7.2.0
├─ @babel/plugin-transform-modules-amd@7.2.0
├─ @babel/plugin-transform-modules-commonjs@7.4.4
├─ @babel/plugin-transform-modules-systemjs@7.4.4
├─ @babel/plugin-transform-modules-umd@7.2.0
├─ @babel/plugin-transform-named-capturing-groups-regex@7.4.5
├─ @babel/plugin-transform-new-target@7.4.4
├─ @babel/plugin-transform-object-super@7.2.0
├─ @babel/plugin-transform-parameters@7.4.4
├─ @babel/plugin-transform-property-literals@7.2.0
├─ @babel/plugin-transform-react-display-name@7.2.0
├─ @babel/plugin-transform-react-jsx-self@7.2.0
├─ @babel/plugin-transform-react-jsx-source@7.2.0
├─ @babel/plugin-transform-react-jsx@7.3.0
├─ @babel/plugin-transform-regenerator@7.4.5
├─ @babel/plugin-transform-reserved-words@7.2.0
├─ @babel/plugin-transform-runtime@7.4.4
├─ @babel/plugin-transform-shorthand-properties@7.2.0
├─ @babel/plugin-transform-spread@7.2.2
├─ @babel/plugin-transform-sticky-regex@7.2.0
├─ @babel/plugin-transform-template-literals@7.4.4
├─ @babel/plugin-transform-typeof-symbol@7.2.0
├─ @babel/plugin-transform-typescript@7.4.5
├─ @babel/plugin-transform-unicode-regex@7.4.4
├─ @babel/polyfill@7.4.4
├─ @babel/preset-env@7.4.5
├─ @babel/preset-react@7.0.0
├─ @babel/preset-typescript@7.3.3
├─ @babel/register@7.4.4
├─ @babel/runtime@7.4.5
├─ @babel/template@7.4.4
├─ @babel/traverse@7.4.5
└─ @babel/types@7.4.4
</code></pre></div>
<p dir="auto">Error Message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error There was a problem parsing component


  ReferenceError: Unknown option: .isTSX. Chec
  k out https://babeljs.io/docs/en/babel-core/
  #options for more information about options.
  
  - options.js:123 throwUnknownError
    [components-documentation]/[@babel]/core/l
    ib/config/validation/options.js:123:11
  
  - options.js:107 Object.keys.forEach.key
    [components-documentation]/[@babel]/core/l
    ib/config/validation/options.js:107:5
  
  - Array.forEach
  
  - options.js:83 validateNested
    [components-documentation]/[@babel]/core/l
    ib/config/validation/options.js:83:21
  
  - options.js:74 validate
    [components-documentation]/[@babel]/core/l
    ib/config/validation/options.js:74:10
  
  - config-chain.js:174 file
    [components-documentation]/[@babel]/core/l
    ib/config/config-chain.js:174:34
  
  - caching.js:33 cachedFunction
    [components-documentation]/[@babel]/core/l
    ib/config/caching.js:33:19
  
  - config-chain.js:120 buildRootChain
    [components-documentation]/[@babel]/core/l
    ib/config/config-chain.js:120:36
  
  - partial.js:85 loadPrivatePartialConfig
    [components-documentation]/[@babel]/core/l
    ib/config/partial.js:85:55
  
  - partial.js:110 Object.loadPartialConfig
    [components-documentation]/[@babel]/core/l
    ib/config/partial.js:110:18
  
  - babelParser.js:44 buildOptions
    [components-documentation]/[react-docgen]/
    dist/babelParser.js:44:31
  
  - babelParser.js:62 buildParse
    [components-documentation]/[react-docgen]/"><pre class="notranslate"><code class="notranslate">error There was a problem parsing component


  ReferenceError: Unknown option: .isTSX. Chec
  k out https://babeljs.io/docs/en/babel-core/
  #options for more information about options.
  
  - options.js:123 throwUnknownError
    [components-documentation]/[@babel]/core/l
    ib/config/validation/options.js:123:11
  
  - options.js:107 Object.keys.forEach.key
    [components-documentation]/[@babel]/core/l
    ib/config/validation/options.js:107:5
  
  - Array.forEach
  
  - options.js:83 validateNested
    [components-documentation]/[@babel]/core/l
    ib/config/validation/options.js:83:21
  
  - options.js:74 validate
    [components-documentation]/[@babel]/core/l
    ib/config/validation/options.js:74:10
  
  - config-chain.js:174 file
    [components-documentation]/[@babel]/core/l
    ib/config/config-chain.js:174:34
  
  - caching.js:33 cachedFunction
    [components-documentation]/[@babel]/core/l
    ib/config/caching.js:33:19
  
  - config-chain.js:120 buildRootChain
    [components-documentation]/[@babel]/core/l
    ib/config/config-chain.js:120:36
  
  - partial.js:85 loadPrivatePartialConfig
    [components-documentation]/[@babel]/core/l
    ib/config/partial.js:85:55
  
  - partial.js:110 Object.loadPartialConfig
    [components-documentation]/[@babel]/core/l
    ib/config/partial.js:110:18
  
  - babelParser.js:44 buildOptions
    [components-documentation]/[react-docgen]/
    dist/babelParser.js:44:31
  
  - babelParser.js:62 buildParse
    [components-documentation]/[react-docgen]/
</code></pre></div>
<p dir="auto">Techstack:</p>
<ul dir="auto">
<li><code class="notranslate">gatsby-transformer-react-docgen</code></li>
<li><code class="notranslate">react-docgen</code></li>
<li><code class="notranslate">@babel/*</code></li>
</ul>