<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
Failing to compile correct code</p>
<p dir="auto"><strong>Input Code</strong></p>
<ul dir="auto">
<li>REPL or Repo link if applicable:</li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {NetworkListenerEvent} from &quot;../listeners/network-listener&quot;;

export enum NetworkControllerEnvironment {
    Unicast,
    Multicast,
    Broadcast,
    All
}

export default interface NetworkController {
    readonly endpoint: string;
    readonly environment: NetworkControllerEnvironment;
    readonly handle: (event: NetworkListenerEvent) =&gt; void;
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-smi">NetworkListenerEvent</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"../listeners/network-listener"</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">enum</span> <span class="pl-smi">NetworkControllerEnvironment</span> <span class="pl-kos">{</span>
    <span class="pl-c1">Unicast</span><span class="pl-kos">,</span>
    <span class="pl-c1">Multicast</span><span class="pl-kos">,</span>
    <span class="pl-c1">Broadcast</span><span class="pl-kos">,</span>
    <span class="pl-c1">All</span>
<span class="pl-kos">}</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">interface</span> <span class="pl-smi">NetworkController</span> <span class="pl-kos">{</span>
    <span class="pl-k">readonly</span> <span class="pl-c1">endpoint</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
    <span class="pl-k">readonly</span> <span class="pl-c1">environment</span>: <span class="pl-smi">NetworkControllerEnvironment</span><span class="pl-kos">;</span>
    <span class="pl-k">readonly</span> <span class="pl-c1">handle</span>: <span class="pl-kos">(</span><span class="pl-s1">event</span>: <span class="pl-smi">NetworkListenerEvent</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-smi"><span class="pl-k">void</span></span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
Compile successfully</p>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;presets&quot;: [
        &quot;@babel/env&quot;,
        &quot;@babel/typescript&quot;
    ],
    &quot;plugins&quot;: [
        &quot;@babel/proposal-class-properties&quot;,
        &quot;@babel/proposal-object-rest-spread&quot;
    ]
}"><pre class="notranslate"><span class="pl-kos">{</span>
    <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span>
        <span class="pl-s">"@babel/env"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/typescript"</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span>
        <span class="pl-s">"@babel/proposal-class-properties"</span><span class="pl-kos">,</span>
        <span class="pl-s">"@babel/proposal-object-rest-spread"</span>
    <span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): v7.0.0-beta.49</li>
<li>Node/npm version: 5.6.0</li>
<li>OS: Windows 10</li>
<li>Monorepo: no</li>
<li>How you are using Babel: cli</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong></p>

<p dir="auto"><strong>Additional context/Screenshots</strong><br>
Stack trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ tsc --emitDeclarationOnly &amp;&amp; babel src --out-dir lib --extensions &quot;.ts,.tsx&quot;
{ SyntaxError: D:\Projects\local-network\src\core\network-controller.ts: Unexpected token, expected &quot;;&quot; (10:25)

   8 | }
   9 |
&gt; 10 | export default interface NetworkController {
     |                          ^
  11 |     readonly endpoint: string;
  12 |     readonly environment: NetworkControllerEnvironment;
  13 |     readonly handle: (event: NetworkListenerEvent) =&gt; void;
    at _class.raise (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:3861:15)
    at _class.unexpected (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:5190:16)
    at _class.semicolon (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:5174:40)
    at _class.parseExportDefaultExpression (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:8149:12
)
    at _class.parseExportDefaultExpression (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:9801:65
)
    at _class.parseExport (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:8102:31)
    at _class.parseExport (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:9784:50)
    at _class.parseStatementContent (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:7172:27)
    at _class.parseStatementContent (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:9816:58)
    at _class.parseStatement (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:7085:17)
  pos: 200,
  loc: Position { line: 10, column: 25 },
  code: 'BABEL_PARSE_ERROR' }"><pre class="notranslate"><code class="notranslate">$ tsc --emitDeclarationOnly &amp;&amp; babel src --out-dir lib --extensions ".ts,.tsx"
{ SyntaxError: D:\Projects\local-network\src\core\network-controller.ts: Unexpected token, expected ";" (10:25)

   8 | }
   9 |
&gt; 10 | export default interface NetworkController {
     |                          ^
  11 |     readonly endpoint: string;
  12 |     readonly environment: NetworkControllerEnvironment;
  13 |     readonly handle: (event: NetworkListenerEvent) =&gt; void;
    at _class.raise (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:3861:15)
    at _class.unexpected (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:5190:16)
    at _class.semicolon (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:5174:40)
    at _class.parseExportDefaultExpression (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:8149:12
)
    at _class.parseExportDefaultExpression (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:9801:65
)
    at _class.parseExport (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:8102:31)
    at _class.parseExport (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:9784:50)
    at _class.parseStatementContent (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:7172:27)
    at _class.parseStatementContent (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:9816:58)
    at _class.parseStatement (D:\Projects\local-network\node_modules\@babel\parser\lib\index.js:7085:17)
  pos: 200,
  loc: Position { line: 10, column: 25 },
  code: 'BABEL_PARSE_ERROR' }
</code></pre></div>
<p dir="auto">Choose one: is this a bug report or feature request?<br>
<strong>Bug report.</strong></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="export default interface A {}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-s1">interface</span> <span class="pl-v">A</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto"><a href="http://babeljs.io/repl/#?babili=false&amp;browsers=&amp;build=&amp;builtIns=false&amp;code_lz=KYDwDg9gTgLgBAE2AMwIYFcA28CWA7GYKNAY2DgEE4BvAXyA&amp;debug=false&amp;circleciRepo=&amp;evaluate=true&amp;lineWrap=false&amp;presets=es2015%2Ces2016%2Ces2017%2Creact%2Cstage-0%2Cstage-1%2Cstage-2%2Cstage-3%2Ces2015-loose%2Ctypescript&amp;prettier=true&amp;targets=Node-8&amp;version=7.0.0-beta.36" rel="nofollow">Parse error in Babel repl</a><br>
<a href="https://www.typescriptlang.org/play/index.html#src=export%20default%20interface%20A%20%7B%7D" rel="nofollow">Works in TypeScript repl</a></p>
<h3 dir="auto">Babel/Babylon Configuration (.babelrc, package.json, cli command)</h3>
<p dir="auto">7.0.0-beta.35 repl with TypeScript transform enabled.</p>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">The syntax was added in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="230828181" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/16040" data-hovercard-type="pull_request" data-hovercard-url="/microsoft/TypeScript/pull/16040/hovercard" href="https://github.com/microsoft/TypeScript/pull/16040">microsoft/TypeScript#16040</a>, so Babel should accept it (and no code should be emitted since it's a type export).</p>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">Babylon gives a parse error saying it's an unexpected token.</p>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">Probably something similar to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="283650526" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/7075" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/7075/hovercard" href="https://github.com/babel/babel/pull/7075">#7075</a> <g-emoji class="g-emoji" alias="smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f604.png">😄</g-emoji></p>
<h3 dir="auto">Context</h3>
<p dir="auto">I have a TypeScript project that I'm trying to run through a custom fork of Babylon, and it's hitting an error on that syntax.</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>master</td>
</tr>
<tr>
<td>Babylon</td>
<td>master (from the last week or so)</td>
</tr>
<tr>
<td>node</td>
<td>9.2.0</td>
</tr>
<tr>
<td>npm</td>
<td>yarn 1.3.2</td>
</tr>
<tr>
<td>Operating System</td>
<td>macOS 10.13.2</td>
</tr>
</tbody>
</table>