mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-24 05:28:01 +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
|
@ -43,13 +43,9 @@ function testMarkdownPluginSchemas(schema: Joi.Schema) {
|
|||
});
|
||||
|
||||
testOK(undefined);
|
||||
testOK([function () {}]);
|
||||
testOK([[function () {}, {attr: 'val'}]]);
|
||||
testOK([
|
||||
[function () {}, {attr: 'val'}],
|
||||
function () {},
|
||||
[function () {}, {attr: 'val'}],
|
||||
]);
|
||||
testOK([() => {}]);
|
||||
testOK([[() => {}, {attr: 'val'}]]);
|
||||
testOK([[() => {}, {attr: 'val'}], () => {}, [() => {}, {attr: 'val'}]]);
|
||||
|
||||
testFail(null);
|
||||
testFail(false);
|
||||
|
@ -58,8 +54,8 @@ function testMarkdownPluginSchemas(schema: Joi.Schema) {
|
|||
testFail([false]);
|
||||
testFail([3]);
|
||||
testFail([[]]);
|
||||
testFail([[function () {}, undefined]]);
|
||||
testFail([[function () {}, true]]);
|
||||
testFail([[() => {}, undefined]]);
|
||||
testFail([[() => {}, true]]);
|
||||
}
|
||||
|
||||
describe('validation schemas', () => {
|
||||
|
|
|
@ -48,7 +48,8 @@ describe('validateFrontMatter', () => {
|
|||
});
|
||||
|
||||
// Fix Yaml trying to convert strings to numbers automatically
|
||||
// We only want to deal with a single type in the final front matter (not string | number)
|
||||
// We only want to deal with a single type in the final front matter
|
||||
// (not string | number)
|
||||
test('should convert number values to string when string schema', () => {
|
||||
const schema = Joi.object<{test: string}>({
|
||||
test: JoiFrontMatter.string(),
|
||||
|
@ -60,7 +61,8 @@ describe('validateFrontMatter', () => {
|
|||
});
|
||||
|
||||
// Helps to fix Yaml trying to convert strings to dates automatically
|
||||
// We only want to deal with a single type in the final front matter (not string | Date)
|
||||
// We only want to deal with a single type in the final front matter
|
||||
// (not string | Date)
|
||||
test('should convert date values when string schema', () => {
|
||||
const schema = Joi.object<{test: string}>({
|
||||
test: JoiFrontMatter.string(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue