summaryrefslogtreecommitdiff
path: root/tools/node_modules/babel-eslint/lib/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/babel-eslint/lib/index.js')
-rw-r--r--tools/node_modules/babel-eslint/lib/index.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/node_modules/babel-eslint/lib/index.js b/tools/node_modules/babel-eslint/lib/index.js
new file mode 100644
index 0000000000..c4655280af
--- /dev/null
+++ b/tools/node_modules/babel-eslint/lib/index.js
@@ -0,0 +1,22 @@
+"use strict";
+
+exports.parse = function(code, options) {
+ return exports.parseForESLint(code, options).ast;
+};
+
+exports.parseForESLint = function(code, options) {
+ options = options || {};
+ options.ecmaVersion = options.ecmaVersion || 2018;
+ options.sourceType = options.sourceType || "module";
+ options.allowImportExportEverywhere =
+ options.allowImportExportEverywhere || false;
+
+ if (options.eslintVisitorKeys && options.eslintScopeManager) {
+ return require("./parse-with-scope")(code, options);
+ }
+ return { ast: require("./parse-with-patch")(code, options) };
+};
+
+exports.parseNoPatch = function(code, options) {
+ return require("./parse")(code, options);
+};