index.js 545 B

12345678910111213141516171819
  1. "use strict";
  2. exports.parse = function(code, options) {
  3. return exports.parseForESLint(code, options).ast;
  4. };
  5. exports.parseForESLint = function(code, options) {
  6. options = options || {};
  7. options.ecmaVersion = options.ecmaVersion || 2018;
  8. options.sourceType = options.sourceType || "module";
  9. options.allowImportExportEverywhere =
  10. options.allowImportExportEverywhere || false;
  11. return require("./parse-with-scope")(code, options);
  12. };
  13. exports.parseNoPatch = function(code, options) {
  14. return require("./parse")(code, options);
  15. };