fixed eslint errors
continuous-integration/drone/push Build is failing Details

nextui
Guus van Meerveld 8 months ago
parent 9da6733481
commit e9d7ea3621

@ -11,7 +11,7 @@
"rules": { "rules": {
"@typescript-eslint/no-non-null-assertion": 0, "@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars": ["error"], "@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/explicit-function-return-type": ["error"], "@typescript-eslint/explicit-function-return-type": "warn",
"padding-line-between-statements": [ "padding-line-between-statements": [
"error", "error",
{ "blankLine": "always", "prev": "*", "next": "block" }, { "blankLine": "always", "prev": "*", "next": "block" },

@ -10,7 +10,7 @@
"", "",
"<THIRD_PARTY_MODULES>", "<THIRD_PARTY_MODULES>",
"", "",
"^(next/.*)|(react.*)", "^(next(/.*)?)|(react.*)",
"", "",
"^@(:?mui|nextui-org)/.*", "^@(:?mui|nextui-org)/.*",
"", "",

@ -2,11 +2,13 @@
import { Nav } from "@/components/Nav"; import { Nav } from "@/components/Nav";
export function Elements({ children }: { children: React.ReactNode }) { import { Component } from "@/typings/component";
export const Elements: Component = ({ children }) => {
return ( return (
<> <>
<Nav /> <Nav />
{children} {children}
</> </>
); );
} };

@ -6,10 +6,13 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { ContextMenuProvider } from "./ContextMenuProvider"; import { ContextMenuProvider } from "./ContextMenuProvider";
export function Providers({ children }: { children: React.ReactNode }) { import { Component } from "@/typings/component";
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } } const queryClient = new QueryClient({
}); defaultOptions: { queries: { retry: false } }
});
export const Providers: Component = ({ children }) => {
return ( return (
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
<ReactQueryDevtools initialIsOpen={false} /> <ReactQueryDevtools initialIsOpen={false} />
@ -18,4 +21,4 @@ export function Providers({ children }: { children: React.ReactNode }) {
</NextUIProvider> </NextUIProvider>
</QueryClientProvider> </QueryClientProvider>
); );
} };

@ -49,7 +49,7 @@ export const Search: Component = () => {
data, data,
error: fetchError, error: fetchError,
fetchNextPage, fetchNextPage,
hasNextPage, // hasNextPage,
refetch, refetch,
isFetching, isFetching,
isFetchingNextPage isFetchingNextPage
@ -63,7 +63,7 @@ export const Search: Component = () => {
}, },
enabled: !!invalidQuery || !!invalidFilter, enabled: !!invalidQuery || !!invalidFilter,
initialPageParam: "", initialPageParam: "",
getNextPageParam: (lastPage, pages) => lastPage.nextCursor getNextPageParam: (lastPage) => lastPage.nextCursor
}); });
const error = invalidQuery ?? invalidFilter ?? fetchError ?? undefined; const error = invalidQuery ?? invalidFilter ?? fetchError ?? undefined;
@ -81,7 +81,7 @@ export const Search: Component = () => {
(visiblity: boolean) => { (visiblity: boolean) => {
if (visiblity && !isFetchingNextPage) fetchNextPage(); if (visiblity && !isFetchingNextPage) fetchNextPage();
}, },
[hasNextPage, isFetchingNextPage, fetchNextPage] [isFetchingNextPage, fetchNextPage]
); );
return ( return (

@ -1,8 +1,9 @@
import { NextPage } from "next";
import { Suspense } from "react"; import { Suspense } from "react";
import { Search } from "./Search"; import { Search } from "./Search";
export default function Page() { const Page: NextPage = () => {
return ( return (
<> <>
<Suspense> <Suspense>
@ -10,4 +11,6 @@ export default function Page() {
</Suspense> </Suspense>
</> </>
); );
} };
export default Page;

@ -47,7 +47,7 @@ export const Trending: Component = ({}) => {
refetch, refetch,
data data
} = useQuery({ } = useQuery({
queryKey: ["trending", region?.code], queryKey: ["trending", region],
queryFn: () => { queryFn: () => {
if (region === null) return; if (region === null) return;

@ -1,10 +1,11 @@
import { NextPage } from "next";
import { Suspense } from "react"; import { Suspense } from "react";
import { LoadingPage } from "@/components/LoadingPage"; import { LoadingPage } from "@/components/LoadingPage";
import { Trending } from "./Trending"; import { Trending } from "./Trending";
export default function Page() { const Page: NextPage = () => {
return ( return (
<> <>
<Suspense fallback={<LoadingPage />}> <Suspense fallback={<LoadingPage />}>
@ -12,4 +13,6 @@ export default function Page() {
</Suspense> </Suspense>
</> </>
); );
} };
export default Page;

@ -1,8 +1,9 @@
import { NextPage } from "next";
import { Suspense } from "react"; import { Suspense } from "react";
import { Watch } from "./Watch"; import { Watch } from "./Watch";
export default function Page() { const Page: NextPage = () => {
return ( return (
<> <>
<Suspense> <Suspense>
@ -10,4 +11,6 @@ export default function Page() {
</Suspense> </Suspense>
</> </>
); );
} };
export default Page;

@ -2,7 +2,6 @@ import z from "zod";
import { StoryboardModel } from "./storyboard"; import { StoryboardModel } from "./storyboard";
import { AuthorThumbnailModel, ThumbnailModel } from "./thumbnail"; import { AuthorThumbnailModel, ThumbnailModel } from "./thumbnail";
import { VideoModel } from "./video";
export const AdaptiveFormatModel = z.object({ export const AdaptiveFormatModel = z.object({
index: z.string(), index: z.string(),

@ -3,7 +3,7 @@
import { useDebounce } from "use-debounce"; import { useDebounce } from "use-debounce";
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
import { useCallback, useMemo, useState } from "react"; import { useMemo, useState } from "react";
import { FiSearch as SearchIcon } from "react-icons/fi"; import { FiSearch as SearchIcon } from "react-icons/fi";
import { Autocomplete, AutocompleteItem } from "@nextui-org/autocomplete"; import { Autocomplete, AutocompleteItem } from "@nextui-org/autocomplete";
@ -33,7 +33,7 @@ export const Search: Component<{
} }
}); });
const submit = (query: string) => { const submit = (query: string): void => {
searchFor(query); searchFor(query);
}; };

@ -28,7 +28,7 @@ export const Video: Component<{ data: VideoProps }> = ({ data }) => {
{ {
title: "Copy video id", title: "Copy video id",
key: "videoId", key: "videoId",
onClick: () => { onClick: (): void => {
navigator.clipboard.writeText(data.id); navigator.clipboard.writeText(data.id);
}, },
showDivider: true showDivider: true
@ -41,7 +41,7 @@ export const Video: Component<{ data: VideoProps }> = ({ data }) => {
{ {
title: "Copy thumnail url", title: "Copy thumnail url",
key: "thumbnailUrl", key: "thumbnailUrl",
onClick: () => { onClick: (): void => {
navigator.clipboard.writeText(data.thumbnail); navigator.clipboard.writeText(data.thumbnail);
}, },
showDivider: true showDivider: true
@ -54,7 +54,7 @@ export const Video: Component<{ data: VideoProps }> = ({ data }) => {
{ {
title: "Copy channel id", title: "Copy channel id",
key: "channelId", key: "channelId",
onClick: () => { onClick: (): void => {
navigator.clipboard.writeText(data.author.id); navigator.clipboard.writeText(data.author.id);
} }
} }

@ -3,7 +3,7 @@ import { useState } from "react";
import Client from "@/client"; import Client from "@/client";
import { ApiType } from "@/client/adapters"; import { ApiType } from "@/client/adapters";
export const useClient = () => { export const useClient = (): Client => {
const [client] = useState( const [client] = useState(
() => () =>
new Client([ new Client([

@ -19,10 +19,10 @@ const useContextMenuStore = create<ContextMenuStore>((set) => ({
show: false, show: false,
location: { x: 0, y: 0 }, location: { x: 0, y: 0 },
items: [], items: [],
showContextMenu(x, y, items) { showContextMenu: (x, y, items): void => {
set({ show: true, location: { x, y }, items }); set({ show: true, location: { x, y }, items });
}, },
hide: () => set({ show: false }) hide: (): void => set({ show: false })
})); }));
export default useContextMenuStore; export default useContextMenuStore;

@ -3,5 +3,5 @@ export interface ContextMenuItem {
key: string; key: string;
showDivider?: boolean; showDivider?: boolean;
href?: string; href?: string;
onClick?: () => any; onClick?: () => unknown;
} }

Loading…
Cancel
Save