mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-19 03:02:30 +02:00
chore: clean up ESLint config, enable a few rules (#6514)
* chore: clean up ESLint config, enable a few rules * enable max-len for comments * fix build
This commit is contained in:
parent
b8ccb869f1
commit
aa446b7a9c
167 changed files with 1157 additions and 960 deletions
|
@ -7,11 +7,6 @@
|
|||
|
||||
import Joi from './Joi';
|
||||
|
||||
// Enhance the default Joi.string() type so that it can convert number to strings
|
||||
// If user use front matter "tag: 2021", we shouldn't need to ask the user to write "tag: '2021'"
|
||||
// Also yaml tries to convert patterns like "2019-01-01" to dates automatically
|
||||
// see https://github.com/facebook/docusaurus/issues/4642
|
||||
// see https://github.com/sideway/joi/issues/1442#issuecomment-823997884
|
||||
const JoiFrontMatterString: Joi.Extension = {
|
||||
type: 'string',
|
||||
base: Joi.string(),
|
||||
|
@ -23,4 +18,12 @@ const JoiFrontMatterString: Joi.Extension = {
|
|||
return {value};
|
||||
},
|
||||
};
|
||||
/**
|
||||
* Enhance the default Joi.string() type so that it can convert number to
|
||||
* strings. If user use front matter "tag: 2021", we shouldn't need to ask her
|
||||
* to write "tag: '2021'". Also yaml tries to convert patterns like "2019-01-01"
|
||||
* to dates automatically.
|
||||
* @see https://github.com/facebook/docusaurus/issues/4642
|
||||
* @see https://github.com/sideway/joi/issues/1442#issuecomment-823997884
|
||||
*/
|
||||
export const JoiFrontMatter: typeof Joi = Joi.extend(JoiFrontMatterString);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue