index.cjs 754 B

12345678910111213141516171819202122232425262728293031
  1. const {
  2. normalizeESLintConfig
  3. } = require("./configuration.cjs");
  4. const analyzeScope = require("./analyze-scope.cjs");
  5. const baseParse = require("./parse.cjs");
  6. const {
  7. LocalClient,
  8. WorkerClient
  9. } = require("./client.cjs");
  10. const client = new LocalClient();
  11. exports.parse = function (code, options = {}) {
  12. return baseParse(code, normalizeESLintConfig(options), client);
  13. };
  14. exports.parseForESLint = function (code, options = {}) {
  15. const normalizedOptions = normalizeESLintConfig(options);
  16. const ast = baseParse(code, normalizedOptions, client);
  17. const scopeManager = analyzeScope(ast, normalizedOptions, client);
  18. return {
  19. ast,
  20. scopeManager,
  21. visitorKeys: client.getVisitorKeys()
  22. };
  23. };
  24. //# sourceMappingURL=index.cjs.map