add proper ecmaVersion and sourceType to parse api

This commit is contained in:
Sebastian McKenzie 2015-04-13 14:55:37 -07:00
parent d4944d606b
commit 061561bfd8

View File

@ -55,7 +55,8 @@ export function transformFileSync(filename: string, opts?: Object = {}) {
}
export function parse(code, opts = {}) {
opts.ecmaVersion = 6;
opts.sourceType = "module";
opts.ecmaVersion = Infinity;
opts.plugins = {
flow: true,
jsx: true