index.cjs 951 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.meta = void 0;
  6. exports.parse = parse;
  7. exports.parseForESLint = parseForESLint;
  8. var _client = require("./client.cjs");
  9. const normalizeESLintConfig = require("./configuration.cjs");
  10. const analyzeScope = require("./analyze-scope.cjs");
  11. const baseParse = require("./parse.cjs");
  12. const client = new _client.LocalClient();
  13. const meta = exports.meta = {
  14. name: "@babel/eslint-parser",
  15. version: "7.23.10"
  16. };
  17. function parse(code, options = {}) {
  18. return baseParse(code, normalizeESLintConfig(options), client);
  19. }
  20. function parseForESLint(code, options = {}) {
  21. const normalizedOptions = normalizeESLintConfig(options);
  22. const ast = baseParse(code, normalizedOptions, client);
  23. const scopeManager = analyzeScope(ast, normalizedOptions, client);
  24. return {
  25. ast,
  26. scopeManager,
  27. visitorKeys: client.getVisitorKeys()
  28. };
  29. }
  30. //# sourceMappingURL=index.cjs.map