Issue 1:
Bug Report

Current Behavior

Failing to compile correct code

Input Code

REPL or Repo link if applicable:

import {NetworkListenerEvent} from "../listeners/network-listener";

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

export default interface NetworkController {
readonly endpoint: string;
readonly environment: NetworkControllerEnvironment;
readonly handle: (event: NetworkListenerEvent) => void;
}

Expected behavior/code

Compile successfully

Babel Configuration (.babelrc, package.json, cli command)

{
"presets": [
"@babel/env",
"@babel/typescript"
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread"
]
}

Environment

Babel version(s): v7.0.0-beta.49

Node/npm version: 5.6.0

OS: Windows 10

Monorepo: no

How you are using Babel: cli

Possible Solution

Additional context/Screenshots

Stack trace:

$ tsc --emitDeclarationOnly && 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 |
> 10 | export default interface NetworkController {
| ^
11 | readonly endpoint: string;
12 | readonly environment: NetworkControllerEnvironment;
13 | readonly handle: (event: NetworkListenerEvent) => 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' }

Issue 2:
Choose one: is this a bug report or feature request?

Bug report.

Input Code

export default interface A {}

Parse error in Babel repl

Works in TypeScript repl

Babel/Babylon Configuration (.babelrc, package.json, cli command)

7.0.0-beta.35 repl with TypeScript transform enabled.

Expected Behavior

The syntax was added in microsoft/TypeScript#16040, so Babel should accept it (and no code should be emitted since it's a type export).

Current Behavior

Babylon gives a parse error saying it's an unexpected token.

Possible Solution

Probably something similar to #7075 😄

Context

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.

Your Environment

software
version(s)

Babel
master

Babylon
master (from the last week or so)

node
9.2.0

npm
yarn 1.3.2

Operating System
macOS 10.13.2