diff --git a/apps/anon-message-client/.eslintrc.js b/apps/anon-message-client/.eslintrc.js new file mode 100644 index 0000000000..dac5168f48 --- /dev/null +++ b/apps/anon-message-client/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + extends: ["@pcd/eslint-config-custom"], + root: true, +}; diff --git a/apps/anon-message-client/package.json b/apps/anon-message-client/package.json index f80af0ecf9..74e6c366fe 100644 --- a/apps/anon-message-client/package.json +++ b/apps/anon-message-client/package.json @@ -30,8 +30,8 @@ "typescript": "5.3.3" }, "devDependencies": { - "eslint": "8.47.0", - "eslint-config-next": "13.4.13", + "@pcd/eslint-config-custom": "0.10.0", + "eslint": "8.57.0", "nodemon": "^3.0.1", "ts-node": "^10.9.2" } diff --git a/apps/anon-message-client/src/app/layout.tsx b/apps/anon-message-client/src/app/layout.tsx index c4a88d89da..1e711d2eb4 100644 --- a/apps/anon-message-client/src/app/layout.tsx +++ b/apps/anon-message-client/src/app/layout.tsx @@ -10,7 +10,7 @@ export default function RootLayout({ children }: { children: React.ReactNode; -}) { +}): JSX.Element { return ( {children} diff --git a/apps/anon-message-client/src/app/page.tsx b/apps/anon-message-client/src/app/page.tsx index 940f0aed51..f5346deb65 100644 --- a/apps/anon-message-client/src/app/page.tsx +++ b/apps/anon-message-client/src/app/page.tsx @@ -30,7 +30,7 @@ async function requestProof( chatId: number, topicId: number, validEventIds: string[] -) { +): Promise { const watermark = getMessageWatermark(message).toString(); console.log("WATERMARK", watermark); const revealedFields = {}; @@ -82,7 +82,7 @@ async function requestProof( } }; - let passportOrigin = `${process.env.NEXT_PUBLIC_PASSPORT_CLIENT_URL}/`; + const passportOrigin = `${process.env.NEXT_PUBLIC_PASSPORT_CLIENT_URL}/`; const returnUrl = `${ process.env.NEXT_PUBLIC_PASSPORT_SERVER_URL }/telegram/message/?message=${encodeURIComponent( @@ -101,7 +101,7 @@ async function requestProof( window.location.href = proofUrl; } -export default function () { +export default function (): JSX.Element { const [message, setMessage] = useState(""); const [invalidMessage, setInvalidMessage] = useState< InvalidMessage | undefined @@ -142,7 +142,7 @@ export default function () { } else if (invalidMessage) { setInvalidMessage(undefined); } - }, [message]); + }, [message, invalidMessage]); const onClick = useCallback(async () => { setLoadingProofUrl(true); @@ -160,7 +160,7 @@ export default function () { topicData.value.validEventIds ); setLoadingProofUrl(false); - }, [message]); + }, [message, topicData]); if (!topicData) { return ( @@ -185,7 +185,7 @@ export default function () {