chore(v2): fix several lint warnings, add missing types, cleanup (#3844)

* fix several lint warnings, add missing types, cleanup

* fix EnumChangefreq issue

* better utilization of EnumChangefreq type

* update test snapshot
This commit is contained in:
Bartosz Kaszubowski 2020-11-30 16:42:58 +01:00 committed by GitHub
parent 139b668737
commit ad31facb32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 228 additions and 171 deletions

View file

@ -9,21 +9,21 @@ import path from 'path';
import fs from 'fs-extra';
import {
aliasedSitePath,
normalizeUrl,
getEditUrl,
parseMarkdownString,
getFolderContainingFile,
normalizeUrl,
parseMarkdownString,
} from '@docusaurus/utils';
import {LoadContext} from '@docusaurus/types';
import {getFileLastUpdate} from './lastUpdate';
import {
DocFile,
DocMetadataBase,
LastUpdateData,
MetadataOptions,
VersionMetadata,
DocFile,
PluginOptions,
VersionMetadata,
} from './types';
import getSlug from './slug';
import {CURRENT_VERSION_NAME} from './constants';
@ -173,7 +173,7 @@ export function processDocMetadata({
// NodeJS optimization.
// Adding properties to object after instantiation will cause hidden
// class transitions.
const metadata: DocMetadataBase = {
return {
unversionedId,
id,
isDocsHomePage,
@ -188,6 +188,4 @@ export function processDocMetadata({
lastUpdatedAt: lastUpdate.lastUpdatedAt,
sidebar_label,
};
return metadata;
}