-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
feat(v2): better error message for invalid plugin config #3979
Conversation
Size Change: 0 B Total Size: 156 kB ℹ️ View Unchanged
|
✔️ Deploy preview for docusaurus-2 ready! 🔨 Explore the source changes: 6505865 🔍 Inspect the deploy logs: https://app.netlify.com/sites/docusaurus-2/deploys/5fed3fd5270be3000819238e 😎 Browse the preview: https://deploy-preview-3979--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-3979--docusaurus-2.netlify.app/classic/ |
Thanks, LGTM However this will not close the related issue, as we still don't accept plugins as plain functions. I mean function MyPlugin() {
return {name: "my-plugin"}
}
module.exports {
plugins: [
MyPlugin,
[MyPlugin,{}],
],
} |
Motivation
As reported by #3934, passing an invalid type of plugin is ignored silently.
ConfigSchema
and the typing ofPluginSchema
itself to anordered
one. Any type of plugin that has a wrong signature but somehow bypasses the check in Adds back support for the "threeColumn" layout to GridBlock.js #1 should be detected by schema validation.Have you read the Contributing Guidelines on pull requests?
yes
Test Plan
Tested locally by manually injecting a function into
plugins
like so:It would give an error:
Also tested without invalid plugin. No errors. It actually should be proven by checks passing on this PR.
Will close #3934 if merged