-
-
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
fix(v2): modify validation schema and tests for rehype/remark + remove duplicate dependency #3247
fix(v2): modify validation schema and tests for rehype/remark + remove duplicate dependency #3247
Conversation
Deploy preview for docusaurus-2 ready! Built with commit c664d34 |
const MarkdownPluginsSchema = Joi.array() | ||
.items( | ||
Joi.array() | ||
// TODO, this allows [config,fn] too? | ||
.items(Joi.function().required(), Joi.object().required()) | ||
.length(2), | ||
.ordered(Joi.function().required(), Joi.object().required()), | ||
Joi.function(), | ||
Joi.object(), | ||
) | ||
.default([]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This completes the TODO for validating 'babel style' input and fixes the validation issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ordered is really cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, looked for that but couldn't find it. Joi doc is a pain :D
@@ -107,8 +107,7 @@ | |||
"webpack-bundle-analyzer": "^3.6.1", | |||
"webpack-dev-server": "^3.11.0", | |||
"webpack-merge": "^4.2.2", | |||
"webpackbar": "^4.0.0", | |||
"@docusaurus/utils-validation": "^2.0.0-alpha.61" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate dependency, the other one is on line 50
expect(value).toEqual(DEFAULT_OPTIONS); | ||
expect(error).toBe(undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible for value
to match when there is an error, so it is safer to include this
LGTM thanks |
Motivation
This PR makes some changes related to validation:
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Automated tests