config-serialize-function.js 942 B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. module.exports = function ({ key, objectKey }) {
  3. // special case for parsers
  4. const isParser =
  5. objectKey === "parser" && (key === "parse" || key === "parseForESLint");
  6. const parserMessage = `
  7. This typically happens when you're using a custom parser that does not
  8. provide a "meta" property, which is how ESLint determines the serialized
  9. representation. Please open an issue with the maintainer of the custom parser
  10. and share this link:
  11. https://eslint.org/docs/latest/extend/custom-parsers#meta-data-in-custom-parsers
  12. `.trim();
  13. return `
  14. The requested operation requires ESLint to serialize configuration data,
  15. but the configuration key "${objectKey}.${key}" contains a function value,
  16. which cannot be serialized.
  17. ${
  18. isParser
  19. ? parserMessage
  20. : "Please double-check your configuration for errors."
  21. }
  22. If you still have problems, please stop by https://eslint.org/chat/help to chat
  23. with the team.
  24. `.trimStart();
  25. };