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

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

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

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

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

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

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

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

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

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

@ -3,7 +3,7 @@
import { useDebounce } from "use-debounce";
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 { 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);
};

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

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

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

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

Loading…
Cancel
Save