chore(v2): Fix linter warnings (#4442)

* chore(v2): Fix linter warnings

223 warnings to 145 warnings

* Remove explicit type annotations

* Do not prefetch when targetLink == null
This commit is contained in:
Sam Zhou 2021-03-17 12:28:42 -04:00 committed by GitHub
parent f041a37622
commit 5e73c72f26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 146 additions and 71 deletions

View file

@ -120,7 +120,10 @@ export function processDocMetadata({
const docsFileDirName = path.dirname(source);
const {frontMatter = {}, excerpt} = parseMarkdownString(content);
const {sidebar_label, custom_edit_url} = frontMatter;
const {
sidebar_label: sidebarLabel,
custom_edit_url: customEditURL,
} = frontMatter;
const baseID: string =
frontMatter.id || path.basename(source, path.extname(source));
@ -206,7 +209,7 @@ export function processDocMetadata({
source: aliasedSitePath(filePath, siteDir),
slug: docSlug,
permalink,
editUrl: custom_edit_url !== undefined ? custom_edit_url : getDocEditUrl(),
editUrl: customEditURL !== undefined ? customEditURL : getDocEditUrl(),
version: versionMetadata.versionName,
lastUpdatedBy: lastUpdate.lastUpdatedBy,
lastUpdatedAt: lastUpdate.lastUpdatedAt,
@ -215,6 +218,6 @@ export function processDocMetadata({
lastUpdate.lastUpdatedAt * 1000,
)
: undefined,
sidebar_label,
sidebar_label: sidebarLabel,
};
}