chore: upgrade TypeScript & other ESLint related deps ()

* chore: upgrade ESLint related deps

* Upgrade TS

* Fix lock

* Bump Babel

* Update config
This commit is contained in:
Joshua Chen 2021-11-18 21:15:37 +08:00 committed by GitHub
commit 0374426ce3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
104 changed files with 2662 additions and 2487 deletions
packages/docusaurus-plugin-content-docs/src/sidebars

View file

@ -36,14 +36,16 @@ describe('DefaultSidebarItemsGenerator', () => {
function mockCategoryMetadataFiles(
categoryMetadataFiles: Record<string, Partial<CategoryMetadataFile>>,
) {
jest.spyOn(fs, 'pathExists').mockImplementation((metadataFilePath) => {
return typeof categoryMetadataFiles[metadataFilePath] !== 'undefined';
});
jest
.spyOn(fs, 'pathExists')
.mockImplementation(
(metadataFilePath) =>
typeof categoryMetadataFiles[metadataFilePath] !== 'undefined',
);
jest.spyOn(fs, 'readFile').mockImplementation(
// @ts-expect-error: annoying TS error due to overrides
async (metadataFilePath: string) => {
return JSON.stringify(categoryMetadataFiles[metadataFilePath]);
},
async (metadataFilePath: string) =>
JSON.stringify(categoryMetadataFiles[metadataFilePath]),
);
}

View file

@ -21,9 +21,7 @@ describe('processSidebars', () => {
];
const StaticSidebarItemsGenerator: SidebarItemsGenerator = jest.fn(
async () => {
return StaticGeneratedSidebarSlice;
},
async () => StaticGeneratedSidebarSlice,
);
async function testProcessSidebars(unprocessedSidebars: NormalizedSidebars) {

View file

@ -73,9 +73,9 @@ export function collectSidebarLinks(sidebar: Sidebar): SidebarItemLink[] {
export function collectSidebarsDocIds(
sidebars: Sidebars,
): Record<string, string[]> {
return mapValues(sidebars, (sidebar) => {
return collectSidebarDocItems(sidebar).map((docItem) => docItem.id);
});
return mapValues(sidebars, (sidebar) =>
collectSidebarDocItems(sidebar).map((docItem) => docItem.id),
);
}
export function createSidebarsUtils(sidebars: Sidebars): {