Skip to content

Commit d97c049

Browse files
committed
Fix linting
1 parent dd1d4e9 commit d97c049

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

frontend/src/components/Chat/index.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { Box, styled, TextField, Typography } from "@mui/material";
22
import { useEffect, useRef, useState } from "react";
3-
import { communicationSocket } from "../../utils/communicationSocket";
3+
import {
4+
CommunicationEvents,
5+
communicationSocket,
6+
} from "../../utils/communicationSocket";
47
import { useMatch } from "../../contexts/MatchContext";
58
import {
69
USE_AUTH_ERROR_MESSAGE,
@@ -15,19 +18,6 @@ type Message = {
1518
createdTime: number;
1619
};
1720

18-
export enum CommunicationEvents {
19-
// receive
20-
JOIN = "join",
21-
SEND_TEXT_MESSAGE = "send_text_message",
22-
DISCONNECT = "disconnect",
23-
24-
// send
25-
USER_JOINED = "user_joined",
26-
ALREADY_JOINED = "already_joined",
27-
TEXT_MESSAGE_RECEIVED = "text_message_received",
28-
DISCONNECTED = "disconnected",
29-
}
30-
3121
type ChatProps = {
3222
isActive: boolean;
3323
};
@@ -66,13 +56,13 @@ const Chat: React.FC<ChatProps> = ({ isActive }) => {
6656
roomId: getMatchId(),
6757
username: user?.username,
6858
});
69-
// eslint-disable-next-line react-hooks/exhaustive-deps
7059

7160
return () => {
7261
console.log("closing socket...");
7362
communicationSocket.close();
7463
setMessages([]); // clear the earlier messages in dev mode
7564
};
65+
// eslint-disable-next-line react-hooks/exhaustive-deps
7666
}, []);
7767

7868
useEffect(() => {

frontend/src/components/QuestionCodeTemplates/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ const QuestionCodeTemplates: React.FC<QuestionCodeTemplatesProps> = ({
6666
event.target.selectionEnd = cursorPosition + 1;
6767
}
6868
};
69-
/* eslint-enable @typescript-eslint/no-explicit-any */
7069

7170
return (
7271
<Box display="flex" flexDirection="column" marginTop={2}>

frontend/src/utils/communicationSocket.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
import { io } from "socket.io-client";
22

3+
export enum CommunicationEvents {
4+
// receive
5+
JOIN = "join",
6+
SEND_TEXT_MESSAGE = "send_text_message",
7+
DISCONNECT = "disconnect",
8+
9+
// send
10+
USER_JOINED = "user_joined",
11+
ALREADY_JOINED = "already_joined",
12+
TEXT_MESSAGE_RECEIVED = "text_message_received",
13+
DISCONNECTED = "disconnected",
14+
}
15+
316
const COMMUNICATION_SOCKET_URL = "http://localhost:3005";
417

518
export const communicationSocket = io(COMMUNICATION_SOCKET_URL, {

0 commit comments

Comments
 (0)