refactor: better typing + remove unnecessary eslint-disable (#5335)

* Initial work

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix a few errors

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Restore default value

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Update docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Use custom route config

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Address a few suggestions

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Revert logo change

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Restore key

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Oops

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove use of any

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove eslint-disable

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Put type reference back

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Remove

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
This commit is contained in:
Joshua Chen 2021-08-11 22:07:17 +08:00 committed by GitHub
parent 0c0c14120e
commit ee6ebc4877
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 127 additions and 122 deletions

View file

@ -5,9 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/
/* eslint-disable import/no-duplicates */
/* eslint-disable camelcase */
declare module '@theme/BlogSidebar' {
export type BlogSidebarItem = {title: string; permalink: string};
export type BlogSidebar = {
@ -28,6 +25,7 @@ declare module '@theme/BlogPostPage' {
import type {BlogSidebar} from '@theme/BlogSidebar';
export type FrontMatter = {
/* eslint-disable camelcase */
readonly title: string;
readonly author?: string;
readonly image?: string;
@ -40,12 +38,15 @@ declare module '@theme/BlogPostPage' {
readonly author_image_url?: string;
readonly authorImageURL?: string;
readonly hide_table_of_contents?: boolean;
/* eslint-enable camelcase */
};
export type FrontMatterAssets = {
/* eslint-disable camelcase */
readonly image?: string;
readonly author_image_url?: string;
readonly authorImageURL?: string;
/* eslint-enable camelcase */
};
export type Metadata = {

View file

@ -5,8 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/
/* eslint-disable camelcase */
import {
JoiFrontMatter as Joi, // Custom instance for frontmatter
URISchema,
@ -15,6 +13,7 @@ import {
import {Tag} from './types';
export type BlogPostFrontMatter = {
/* eslint-disable camelcase */
id?: string;
title?: string;
description?: string;
@ -36,6 +35,7 @@ export type BlogPostFrontMatter = {
authorTitle?: string;
authorURL?: string;
authorImageURL?: string;
/* eslint-enable camelcase */
};
// NOTE: we don't add any default value on purpose here