mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +02:00
refactor(v2): use correct plugin types (#4418)
This commit is contained in:
parent
1078341b22
commit
abae86f283
11 changed files with 69 additions and 80 deletions
|
@ -21,7 +21,6 @@ import {
|
|||
STATIC_DIR_NAME,
|
||||
DEFAULT_PLUGIN_ID,
|
||||
} from '@docusaurus/core/lib/constants';
|
||||
import {ValidationError} from 'joi';
|
||||
import {flatten, take, kebabCase} from 'lodash';
|
||||
|
||||
import {
|
||||
|
@ -56,7 +55,7 @@ import {
|
|||
export default function pluginContentBlog(
|
||||
context: LoadContext,
|
||||
options: PluginOptions,
|
||||
): Plugin<BlogContent | null, typeof PluginOptionSchema> {
|
||||
): Plugin<BlogContent | null> {
|
||||
if (options.admonitions) {
|
||||
options.remarkPlugins = options.remarkPlugins.concat([
|
||||
[admonitions, options.admonitions],
|
||||
|
@ -561,10 +560,7 @@ export default function pluginContentBlog(
|
|||
export function validateOptions({
|
||||
validate,
|
||||
options,
|
||||
}: OptionValidationContext<PluginOptions, ValidationError>): ValidationResult<
|
||||
PluginOptions,
|
||||
ValidationError
|
||||
> {
|
||||
}: OptionValidationContext<PluginOptions>): ValidationResult<PluginOptions> {
|
||||
const validatedOptions = validate(PluginOptionSchema, options);
|
||||
return validatedOptions;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue