fix most lint warnings

This commit is contained in:
m5r 2021-08-30 07:13:06 +08:00
parent e9fb2602ae
commit 87e3fc77d8
6 changed files with 7 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import Link from "next/link";
export default function CoverImage({ title, responsiveImage, slug }: any) { export default function CoverImage({ title, responsiveImage, slug }: any) {
const image = ( const image = (
// eslint-disable-next-line jsx-a11y/alt-text
<Image <Image
data={{ data={{
...responsiveImage, ...responsiveImage,

View File

@ -17,5 +17,6 @@ export const usePanelbear = (siteId?: string, config: PanelbearConfig = {}) => {
router.events.on("routeChangeComplete", handleRouteChange); router.events.on("routeChangeComplete", handleRouteChange);
return () => router.events.off("routeChangeComplete", handleRouteChange); return () => router.events.off("routeChangeComplete", handleRouteChange);
// eslint-disable-next-line
}, [siteId]); }, [siteId]);
}; };

View File

@ -1,4 +1,4 @@
import { Suspense, useEffect, useRef } from "react"; import { Suspense, useEffect, useMemo, useRef } from "react";
import { useRouter } from "blitz"; import { useRouter } from "blitz";
import clsx from "clsx"; import clsx from "clsx";
@ -10,7 +10,7 @@ export default function Conversation() {
const router = useRouter(); const router = useRouter();
const recipient = decodeURIComponent(router.params.recipient); const recipient = decodeURIComponent(router.params.recipient);
const conversation = useConversation(recipient)[0]; const conversation = useConversation(recipient)[0];
const messages = conversation?.messages ?? []; const messages = useMemo(() => conversation?.messages ?? [], [conversation?.messages]);
const messagesListRef = useRef<HTMLUListElement>(null); const messagesListRef = useRef<HTMLUListElement>(null);
useEffect(() => { useEffect(() => {

View File

@ -19,7 +19,7 @@ const Messages: BlitzPage = () => {
if (!subscription) { if (!subscription) {
subscribe(); subscribe();
} }
}, [subscription?.endpoint]); }, [subscribe, subscription]);
return ( return (
<> <>

View File

@ -41,6 +41,7 @@ const OutgoingCall: BlitzPage = () => {
if (call.state === "ready") { if (call.state === "ready") {
call.makeCall(); call.makeCall();
} }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [call.state]); }, [call.state]);
return ( return (

View File

@ -12,7 +12,7 @@ function Header() {
<div className="flex-shrink-0 mr-5"> <div className="flex-shrink-0 mr-5">
<Link href="/"> <Link href="/">
<a className="block"> <a className="block">
<img className="w-10 h-10" src="/shellphone.png" /> <img className="w-10 h-10" src="/shellphone.png" alt="Shellphone logo" />
</a> </a>
</Link> </Link>
</div> </div>