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