refactor: reduce number of leaked anys (#7465)

This commit is contained in:
Joshua Chen 2022-05-23 00:30:32 +08:00 committed by GitHub
parent 6e62bba30f
commit 89b0fff128
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 121 additions and 89 deletions

View file

@ -53,7 +53,7 @@ async function createVersionedSidebarFile({
// Tests depend on non-default export for mocking.
export async function cliDocsVersionCommand(
version: string,
version: unknown,
{id: pluginId, path: docsPath, sidebarPath}: PluginOptions,
{siteDir, i18n}: LoadContext,
): Promise<void> {
@ -70,7 +70,7 @@ export async function cliDocsVersionCommand(
}
// Load existing versions.
let versions = [];
let versions: string[] = [];
const versionsJSONFile = getVersionsFilePath(siteDir, pluginId);
if (await fs.pathExists(versionsJSONFile)) {
versions = await fs.readJSON(versionsJSONFile);