chore(v2): Fix more linter warnings (#4450)

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

View file

@ -78,7 +78,7 @@ function normalizeCategoryShorthand(
function assertItem<K extends string>(
item: Record<string, unknown>,
keys: K[],
): asserts item is Record<K, any> {
): asserts item is Record<K, never> {
const unknownKeys = Object.keys(item).filter(
// @ts-expect-error: key is always string
(key) => !keys.includes(key as string) && key !== 'type',
@ -272,9 +272,7 @@ export function collectSidebarsDocIds(
});
}
export function createSidebarsUtils(
sidebars: Sidebars,
): Record<string, Function> {
export function createSidebarsUtils(sidebars: Sidebars) {
const sidebarNameToDocIds = collectSidebarsDocIds(sidebars);
function getFirstDocIdOfFirstSidebar(): string | undefined {