parcoursup/node_modules/recast/parsers/_babel_options.js
lalBi94 7bc56c09b5 $
2023-03-05 13:23:23 +01:00

43 lines
1.4 KiB
JavaScript

"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;
;