fix(validation): improve error messages for a few schemas (#6997)

* fix(validation): improve error messages for a few schemas

* kick CI

* fix test
This commit is contained in:
Joshua Chen 2022-03-25 21:50:37 +08:00 committed by GitHub
parent d879cdca96
commit f1bcdbff63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 114 additions and 44 deletions

View file

@ -23,6 +23,11 @@ const MarkdownPluginsSchema = Joi.array()
Joi.function(),
Joi.object(),
)
.messages({
'array.includes': `{#label} does not look like a valid MDX plugin config. A plugin config entry should be one of:
- A tuple, like \`[require("rehype-katex"), \\{ strict: false \\}]\`, or
- A simple module, like \`require("remark-math")\``,
})
.default([]);
export const RemarkPluginsSchema = MarkdownPluginsSchema;