diff --git a/frontend/components/Runner.tsx b/frontend/components/Runner.tsx index 4ede07e..b68597c 100644 --- a/frontend/components/Runner.tsx +++ b/frontend/components/Runner.tsx @@ -9,22 +9,32 @@ export default function Runner({ runner }: { runner: RunnerInformation }) { {runner.name} - {runner.platform === 'TWITCH' && runner.stream.length > 0 ? - - : ''} - {runner.platform === 'FACEBOOK' && runner.stream.length > 0 ? - - : ''} - {runner.platform === 'YOUTUBE' && runner.stream.length > 0 ? - - : ''} - {runner.twitter && runner.twitter.length > 0 ? - - : ''} - {runner.youtube && runner.youtube.length > 0 ? - - : ''} + {runner.platform === 'TWITCH' && runner.stream.length > 0 ? ( + + + + ) : ''} + {runner.platform === 'FACEBOOK' && runner.stream.length > 0 ? ( + + + + ) : ''} + {runner.platform === 'YOUTUBE' && runner.stream.length > 0 ? ( + + + + ) : ''} + {runner.twitter && runner.twitter.length > 0 ? ( + + + + ) : ''} + {runner.youtube && runner.youtube.length > 0 ? ( + + + + ) : ''} - ) + ); } diff --git a/frontend/components/localization/WrapReactIntl.tsx b/frontend/components/localization/WrapReactIntl.tsx index 2623d7c..9fe56ec 100644 --- a/frontend/components/localization/WrapReactIntl.tsx +++ b/frontend/components/localization/WrapReactIntl.tsx @@ -20,7 +20,7 @@ import { Spinner } from 'react-bootstrap'; import { isPolyfillPhaseDone } from 'util/localization'; export default function WrapReactIntl

(Component: React.ComponentType

) { - return (props: P) => { + return function (props: P) { if (!isPolyfillPhaseDone()) { return ( - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ diff --git a/frontend/pages/404.tsx b/frontend/pages/404.tsx index 2b94c3d..71cb708 100644 --- a/frontend/pages/404.tsx +++ b/frontend/pages/404.tsx @@ -16,9 +16,9 @@ */ import * as React from 'react'; -import Error from "./_error"; +import Error from './_error'; -const Error404Page = () => ( - -) +function Error404Page() { + return ; +} export default Error404Page; diff --git a/frontend/pages/[id].tsx b/frontend/pages/[id].tsx index 63d1356..5ab0a87 100644 --- a/frontend/pages/[id].tsx +++ b/frontend/pages/[id].tsx @@ -43,7 +43,9 @@ interface VideoListPageProps { runners?: RunnerList, } -export const getServerSideProps: GetServerSideProps = async ({ params: { id } }) => { +export const getServerSideProps: GetServerSideProps = async ({ + params: { id }, +}) => { // Fetch URL to thumbnails server const { ids, @@ -94,14 +96,14 @@ export const getServerSideProps: GetServerSideProps = async }; }; -const VideoListPage: NextPage = ({ +const VideoListPage: NextPage = function VideoListPage({ id, lastUpdatedAt, thumbnailServerURL, title, videos, runners, -}) => { +}) { if (!id) { return notFound(); } diff --git a/frontend/pages/_error.tsx b/frontend/pages/_error.tsx index 7ac34a2..d1ea19c 100644 --- a/frontend/pages/_error.tsx +++ b/frontend/pages/_error.tsx @@ -21,10 +21,10 @@ import Head from 'next/head'; import * as React from 'react'; import { useIntl } from 'react-intl'; -const Error: NextPage = ({ +const Error: NextPage = function Error({ statusCode, title, -}) => { +}) { const intl = useIntl(); return (

@@ -46,14 +46,16 @@ const Error: NextPage = ({

{statusCode} {title}

- ) -} + ); +}; Error.getInitialProps = (ctx) => { const { res, err } = ctx; - const statusCode = res ? res.statusCode : err ? err.statusCode : 404; - const title = res ? res.statusMessage : err ? err.message : "Page not found"; - return { statusCode, title } -} + // eslint-disable-next-line no-nested-ternary + const statusCode = res ? res.statusCode : (err ? err.statusCode : 404); + // eslint-disable-next-line no-nested-ternary + const title = res ? res.statusMessage : (err ? err.message : 'Page not found'); + return { statusCode, title }; +}; -export default Error +export default Error; diff --git a/frontend/pages/api/changePreferences.ts b/frontend/pages/api/changePreferences.ts index 65ae687..c29dce9 100644 --- a/frontend/pages/api/changePreferences.ts +++ b/frontend/pages/api/changePreferences.ts @@ -1,16 +1,16 @@ /** * Copyright (C) 2019-2021 Carl Kittelberger - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ diff --git a/frontend/pages/api/user.ts b/frontend/pages/api/user.ts index b0e97e8..fd24d74 100644 --- a/frontend/pages/api/user.ts +++ b/frontend/pages/api/user.ts @@ -1,16 +1,16 @@ /** * Copyright (C) 2019-2021 Carl Kittelberger - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ diff --git a/frontend/pages/index.tsx b/frontend/pages/index.tsx index 4a8cc04..2fac355 100644 --- a/frontend/pages/index.tsx +++ b/frontend/pages/index.tsx @@ -37,7 +37,7 @@ export const getServerSideProps: GetServerSideProps = async () => ({ index: await getIndex(), }, }); -const Home: NextPage = ({ index: { announcements, ids } }) => { +const Home: NextPage = function Home({ index: { announcements, ids } }) { const intl = useIntl(); return (
diff --git a/frontend/pages/robots.txt.ts b/frontend/pages/robots.txt.ts index 5854589..a0f78ec 100644 --- a/frontend/pages/robots.txt.ts +++ b/frontend/pages/robots.txt.ts @@ -1,16 +1,16 @@ /** * Copyright (C) 2019-2021 Carl Kittelberger - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ diff --git a/frontend/pages/sitemap.xml.ts b/frontend/pages/sitemap.xml.ts index 7072c5e..ac1f188 100644 --- a/frontend/pages/sitemap.xml.ts +++ b/frontend/pages/sitemap.xml.ts @@ -1,16 +1,16 @@ /** * Copyright (C) 2019-2021 Carl Kittelberger - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ diff --git a/frontend/typings/url-slug/index.d.ts b/frontend/typings/url-slug/index.d.ts index 07e9751..caa5c14 100644 --- a/frontend/typings/url-slug/index.d.ts +++ b/frontend/typings/url-slug/index.d.ts @@ -5,12 +5,12 @@ export type UrlSlugTransformer = ( separator: UrlSlugSeparator ) => string; -export type UrlSlugSeparator = '-'|'.'|'_'|'~'|''; +export type UrlSlugSeparator = '-' | '.' | '_' | '~' | ''; export interface UrlSlugOptions { camelCase?: boolean = true; separator?: UrlSlugSeparator = '-'; - transformer: false|UrlSlugTransformer = false; + transformer: false | UrlSlugTransformer = false; } declare function urlSlug( diff --git a/frontend/util/types.ts b/frontend/util/types.ts index 607ac03..fafd2d4 100644 --- a/frontend/util/types.ts +++ b/frontend/util/types.ts @@ -15,4 +15,4 @@ * along with this program. If not, see . */ -export type UnboxPromise> = T extends Promise ? U: never; +export type UnboxPromise> = T extends Promise ? U : never;