1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| "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: (0, util_1.getOption)(options, "sourceType", "module"),
| strictMode: (0, util_1.getOption)(options, "strictMode", false),
| allowImportExportEverywhere: true,
| allowReturnOutsideFunction: true,
| startLine: 1,
| tokens: true,
| plugins: [
| "asyncGenerators",
| "bigInt",
| "classPrivateMethods",
| "classPrivateProperties",
| "classProperties",
| "classStaticBlock",
| "decimal",
| "decorators-legacy",
| "doExpressions",
| "dynamicImport",
| "exportDefaultFrom",
| "exportExtensions",
| "exportNamespaceFrom",
| "functionBind",
| "functionSent",
| "importAssertions",
| "importMeta",
| "nullishCoalescingOperator",
| "numericSeparator",
| "objectRestSpread",
| "optionalCatchBinding",
| "optionalChaining",
| [
| "pipelineOperator",
| {
| proposal: "minimal",
| },
| ],
| [
| "recordAndTuple",
| {
| syntaxType: "hash",
| },
| ],
| "throwExpressions",
| "topLevelAwait",
| "v8intrinsic",
| ],
| };
| }
| exports.default = getBabelOptions;
|
|