mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-28 14:08:21 +02:00
misc: convert all internal scripts to ESM (#6286)
* misc: convert all internal scripts to ESM * fixes * fix * fixes * fix! * complete eslint * more move * fix! * This looks better? * Final ones
This commit is contained in:
parent
bcc05e243f
commit
4fad1ce0cd
66 changed files with 412 additions and 374 deletions
|
@ -5,10 +5,11 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const {validateThemeConfig, DEFAULT_CONFIG} = require('../validateThemeConfig');
|
||||
import type {Joi} from '@docusaurus/utils-validation';
|
||||
import {validateThemeConfig, DEFAULT_CONFIG} from '../validateThemeConfig';
|
||||
|
||||
function testValidateThemeConfig(themeConfig) {
|
||||
function validate(schema, cfg) {
|
||||
function testValidateThemeConfig(themeConfig: Record<string, unknown>) {
|
||||
function validate(schema: Joi.Schema, cfg: Record<string, unknown>) {
|
||||
const {value, error} = schema.validate(cfg, {
|
||||
convert: false,
|
||||
});
|
|
@ -8,7 +8,7 @@
|
|||
import {Joi} from '@docusaurus/utils-validation';
|
||||
import type {ThemeConfig, Validate, ValidationResult} from '@docusaurus/types';
|
||||
|
||||
const DEFAULT_CONFIG = {
|
||||
export const DEFAULT_CONFIG = {
|
||||
contextualSearch: false, // future: maybe we want to enable this by default
|
||||
|
||||
// By default, all Docusaurus sites are using the same AppId
|
||||
|
@ -17,7 +17,6 @@ const DEFAULT_CONFIG = {
|
|||
|
||||
searchParameters: {},
|
||||
};
|
||||
exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
|
||||
|
||||
export const Schema = Joi.object({
|
||||
algolia: Joi.object({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue