You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

42 lines
1.4 KiB

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("../lib/util");
function getBabelOptions(options) {
// The goal here is to tolerate as much syntax as possible, since Recast
// is not in the business of forbidding anything. If you want your
// parser to be more restrictive for some reason, you can always pass
// your own parser object to recast.parse.
return {
sourceType: util_1.getOption(options, "sourceType", "module"),
strictMode: util_1.getOption(options, "strictMode", false),
allowImportExportEverywhere: true,
allowReturnOutsideFunction: true,
startLine: 1,
tokens: true,
plugins: [
"asyncGenerators",
"bigInt",
"classPrivateMethods",
"classPrivateProperties",
"classProperties",
"decorators-legacy",
"doExpressions",
"dynamicImport",
"exportDefaultFrom",
"exportExtensions",
"exportNamespaceFrom",
"functionBind",
"functionSent",
"importMeta",
"nullishCoalescingOperator",
"numericSeparator",
"objectRestSpread",
"optionalCatchBinding",
"optionalChaining",
["pipelineOperator", { proposal: "minimal" }],
"throwExpressions",
]
};
}
exports.default = getBabelOptions;
;