Skip to content

Commit 5791ac3

Browse files
authored
chore(gatsby-source-filesystem): add pluginOptionsSchema (gatsbyjs#27422)
1 parent 705ff91 commit 5791ac3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/gatsby-source-filesystem/src/gatsby-node.js

+9
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ const createFSMachine = (
146146
return interpret(fsMachine).start()
147147
}
148148

149+
if (process.env.GATSBY_EXPERIMENTAL_PLUGIN_OPTION_VALIDATION) {
150+
exports.pluginOptionsSchema = ({ Joi }) =>
151+
Joi.object({
152+
name: Joi.string(),
153+
path: Joi.string(),
154+
ignore: Joi.array().items(Joi.string()),
155+
})
156+
}
157+
149158
exports.sourceNodes = (api, pluginOptions) => {
150159
// Validate that the path exists.
151160
if (!fs.existsSync(pluginOptions.path)) {

0 commit comments

Comments
 (0)