blob: 4300e47e452ac9a8f22ffb80fe45f5ffbcb011db [file] [log] [blame]
Simon Zünd87795792025-03-24 08:36:231"use strict";
2
Nikolay Vitkovd38bb9f2025-04-22 17:21:373module.exports = function ({ key, objectKey }) {
4 // special case for parsers
5 const isParser =
6 objectKey === "parser" && (key === "parse" || key === "parseForESLint");
7 const parserMessage = `
Simon Zünd87795792025-03-24 08:36:238 This typically happens when you're using a custom parser that does not
9provide a "meta" property, which is how ESLint determines the serialized
10representation. Please open an issue with the maintainer of the custom parser
11and share this link:
12
13https://eslint.org/docs/latest/extend/custom-parsers#meta-data-in-custom-parsers
14`.trim();
15
Nikolay Vitkovd38bb9f2025-04-22 17:21:3716 return `
Simon Zünd87795792025-03-24 08:36:2317The requested operation requires ESLint to serialize configuration data,
18but the configuration key "${objectKey}.${key}" contains a function value,
19which cannot be serialized.
20
21${
Nikolay Vitkovd38bb9f2025-04-22 17:21:3722 isParser
23 ? parserMessage
24 : "Please double-check your configuration for errors."
Simon Zünd87795792025-03-24 08:36:2325}
26
27If you still have problems, please stop by https://eslint.org/chat/help to chat
28with the team.
29`.trimStart();
30};