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

Conversation

mxstbr
Copy link
Contributor

@mxstbr mxstbr commented Oct 28, 2020

The documented form to configure gatsby-plugin-mdx with remark/hypePlugins is to require them:

{
  resolve: `gatsby-plugin-mdx`,
  options: {
    remarkPlugins: [require(`remark-slug`)]
  }
}

The current pluginOptionsSchema for gatsby-plugin-mdx throws an error with this (valid!) configuration, stating that "remarkPlugins[0] should be object or array", which is inaccurate.

This fixes it by adding the correct type (function) to the possibilities for this array. Verified it works as expected by running the fix against the theme-ui docs website, which fails before this fix but works as expected afterwards.

@mxstbr mxstbr requested a review from a team as a code owner October 28, 2020 13:29
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 28, 2020
@@ -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.

@mxstbr mxstbr merged commit 21f24f8 into master Oct 28, 2020
@delete-merged-branch delete-merged-branch bot deleted the mdx/plugins-type branch October 28, 2020 21:38
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants