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

docs(readme): add file extension, fix code block, fix link, fix code #28905

Merged
merged 2 commits into from
Jan 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/gatsby-plugin-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
npm install gatsby-plugin-utils
```

### validateOptionsSchema
### `validateOptionsSchema`

The `validateOptionsSchema` function verifies that the proper data types of options were passed into a plugin from the `gatsby-config` file. It is called internally by Gatsby to validate each plugin's options when a site is started.
The `validateOptionsSchema` function verifies that the proper data types of options were passed into a plugin from the `gatsby-config.js` file. It is called internally by Gatsby to validate each plugin's options when a site is started.

#### Example

Expand All @@ -18,9 +18,9 @@ import { validateOptionsSchema } from "gatsby-plugin-utils"
await validateOptionsSchema(pluginName, pluginSchema, pluginOptions)
```

### testPluginOptionsSchema
### `testPluginOptionsSchema`

Utility to validate and test plugin options schemas. An example of a plugin options schema implementation can be found in the [gatsby-node.js file of gatsby-plugin-google-analytics](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-utils).
Utility to validate and test plugin options schemas. An example of a plugin options schema implementation can be found in the [`gatsby-node.js` file of `gatsby-plugin-google-analytics`](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-google-analytics/src/gatsby-node.js).

#### Example

Expand All @@ -31,7 +31,7 @@ import { testPluginOptionsSchema } from "gatsby-plugin-utils"
it(`should partially validate one value of a schema`, async () => {
const pluginSchema = ({ Joi }) =>
Joi.object({
someOtherValue: Joi.string()
someOtherValue: Joi.string(),
toVerify: Joi.boolean(),
})

Expand Down