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(Config Schema): Add enhanced object syntax for plugins #8259

Merged
merged 1 commit into from Sep 18, 2020
Merged
Changes from all 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
15 changes: 14 additions & 1 deletion lib/configSchema.js
Expand Up @@ -32,7 +32,20 @@ const schema = {
required: [],
// User is free to add any properties for its own purpose
},
plugins: { type: 'array', items: { type: 'string' } },
plugins: {
anyOf: [
{
type: 'object',
properties: {
localPath: { type: 'string' },
modules: { type: 'array', items: { type: 'string' } },
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's make modules required, also let's add additionalProperties: false, so eventual typos are picked and not ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made these 2 changes. Thanks!

additionalProperties: false,
required: ['modules'],
},
{ type: 'array', items: { type: 'string' } },
],
},

functions: {
type: 'object',
Expand Down