Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-plugin-mdx): remark/hypePlugins options schema #27698

Merged
merged 3 commits into from Oct 28, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 19 additions & 5 deletions packages/gatsby-plugin-mdx/gatsby-node.js
Expand Up @@ -6,7 +6,7 @@ const fs = require(`fs`)

const {
onCreateNode,
unstable_shouldOnCreateNode
unstable_shouldOnCreateNode,
} = require(`./gatsby/on-create-node`)

/**
Expand Down Expand Up @@ -77,7 +77,7 @@ if (process.env.GATSBY_EXPERIMENTAL_PLUGIN_OPTION_VALIDATION) {
.description(
`Configure the file extensions that gatsby-plugin-mdx will process`
),
defaultLayout: Joi.object({})
defaultLayouts: Joi.object({})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a typo, as the option is actually called defaultLayouts.

.unknown(true)
.default({})
.description(`Set the layout components for MDX source types`),
Expand All @@ -94,17 +94,31 @@ if (process.env.GATSBY_EXPERIMENTAL_PLUGIN_OPTION_VALIDATION) {
remarkPlugins: Joi.array()
.items(
Joi.alternatives().try(
Joi.object({}).unknown(true),
Joi.array().items(Joi.object({}).unknown(true))
Joi.alternatives().try(
Joi.function(),
Joi.object({}).unknown(true),
Joi.array().items(
Joi.alternatives().try(
Joi.object({}).unknown(true),
Joi.function()
)
)
)
)
)
.default([])
.description(`Specify remark plugins`),
rehypePlugins: Joi.array()
.items(
Joi.alternatives().try(
Joi.function(),
Joi.object({}).unknown(true),
Joi.array().items(Joi.object({}).unknown(true))
Joi.array().items(
Joi.alternatives().try(
Joi.object({}).unknown(true),
Joi.function()
)
)
)
)
.default([])
Expand Down