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

@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import {PrismTheme} from 'prism-react-renderer';
import {CSSProperties} from 'react';
export type DocsVersionPersistence = 'localStorage' | 'none';
@ -32,11 +34,39 @@ export type Navbar = {
logo?: NavbarLogo;
};
export type ColorModeConfig = {
defaultMode: 'light' | 'dark';
disableSwitch: boolean;
respectPrefersColorScheme: boolean;
switchConfig: {
darkIcon: string;
darkIconStyle: CSSProperties;
lightIcon: string;
lightIconStyle: CSSProperties;
};
};
export type AnnouncementBarConfig = {
id: string;
content: string;
backgroundColor: string;
textColor: string;
isCloseable: boolean;
};
export type PrismConfig = {
theme?: PrismTheme;
darkTheme?: PrismTheme;
defaultLanguage?: string;
additionalLanguages?: string[];
};
export type FooterLinkItem = {
label?: string;
to?: string;
href?: string;
html?: string;
prependBaseUrlToHref?: string;
};
export type FooterLinks = {
title?: string;
@ -65,11 +95,11 @@ export type ThemeConfig = {
// TODO temporary types
navbar: Navbar;
colorMode: any;
announcementBar: any;
prism: any;
footer: Footer | undefined;
hideableSidebar: any;
colorMode: ColorModeConfig;
announcementBar?: AnnouncementBarConfig;
prism: PrismConfig;
footer?: Footer;
hideableSidebar: boolean;
};
export function useThemeConfig(): ThemeConfig {