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) {
const image = (
// eslint-disable-next-line jsx-a11y/alt-text
<Image
data={{
...responsiveImage,

View File

@ -17,5 +17,6 @@ export const usePanelbear = (siteId?: string, config: PanelbearConfig = {}) => {
router.events.on("routeChangeComplete", handleRouteChange);
return () => router.events.off("routeChangeComplete", handleRouteChange);
// eslint-disable-next-line
}, [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 clsx from "clsx";
@ -10,7 +10,7 @@ export default function Conversation() {
const router = useRouter();
const recipient = decodeURIComponent(router.params.recipient);
const conversation = useConversation(recipient)[0];
const messages = conversation?.messages ?? [];
const messages = useMemo(() => conversation?.messages ?? [], [conversation?.messages]);
const messagesListRef = useRef<HTMLUListElement>(null);
useEffect(() => {

View File

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

View File

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

View File

@ -12,7 +12,7 @@ function Header() {
<div className="flex-shrink-0 mr-5">
<Link href="/">
<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>
</Link>
</div>