chore(v2): Fix more linter warnings ()

This commit is contained in:
Sam Zhou 2021-03-18 13:05:09 -04:00 committed by GitHub
parent 3422f80a9a
commit 83d043ecb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 116 additions and 85 deletions
packages/docusaurus-utils-validation/src

View file

@ -8,13 +8,13 @@ exports[`validation schemas AdmonitionsSchema: for value=null 1`] = `"\\"value\\
exports[`validation schemas AdmonitionsSchema: for value=true 1`] = `"\\"value\\" must be of type object"`;
exports[`validation schemas PluginIdSchema: for value="/docs" 1`] = `"\\"value\\" with value \\"/docs\\" fails to match the required pattern: /^[a-zA-Z_\\\\-]+$/"`;
exports[`validation schemas PluginIdSchema: for value="/docs" 1`] = `"\\"value\\" with value \\"/docs\\" fails to match the required pattern: /^[a-zA-Z_-]+$/"`;
exports[`validation schemas PluginIdSchema: for value="do cs" 1`] = `"\\"value\\" with value \\"do cs\\" fails to match the required pattern: /^[a-zA-Z_\\\\-]+$/"`;
exports[`validation schemas PluginIdSchema: for value="do cs" 1`] = `"\\"value\\" with value \\"do cs\\" fails to match the required pattern: /^[a-zA-Z_-]+$/"`;
exports[`validation schemas PluginIdSchema: for value="do/cs" 1`] = `"\\"value\\" with value \\"do/cs\\" fails to match the required pattern: /^[a-zA-Z_\\\\-]+$/"`;
exports[`validation schemas PluginIdSchema: for value="do/cs" 1`] = `"\\"value\\" with value \\"do/cs\\" fails to match the required pattern: /^[a-zA-Z_-]+$/"`;
exports[`validation schemas PluginIdSchema: for value="docs/" 1`] = `"\\"value\\" with value \\"docs/\\" fails to match the required pattern: /^[a-zA-Z_\\\\-]+$/"`;
exports[`validation schemas PluginIdSchema: for value="docs/" 1`] = `"\\"value\\" with value \\"docs/\\" fails to match the required pattern: /^[a-zA-Z_-]+$/"`;
exports[`validation schemas PluginIdSchema: for value=[] 1`] = `"\\"value\\" must be a string"`;

View file

@ -8,7 +8,7 @@ import * as Joi from 'joi';
import {isValidPathname} from '@docusaurus/utils';
export const PluginIdSchema = Joi.string()
.regex(/^[a-zA-Z_\-]+$/)
.regex(/^[a-zA-Z_-]+$/)
// duplicate core constant, otherwise cyclic dependency is created :(
.default('default');