Skip to content

Commit 3b626ba

Browse files
authored
Merge pull request #25 from CleanEngine/develop
[FE] - 유지보수를 위한 sonarqube issue resolve
2 parents 8029ccf + 8922b9a commit 3b626ba

File tree

29 files changed

+57
-48
lines changed

29 files changed

+57
-48
lines changed

src/app/entry.client.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ import { hydrateRoot } from 'react-dom/client';
44
import { HydratedRouter } from 'react-router/dom';
55

66
async function prepareApp() {
7-
// if (process.env.NODE_ENV === 'development') {
8-
// const { worker } = await import('../mocks/browser');
9-
// return worker.start({ onUnhandledRequest: 'bypass' });
10-
// }
11-
127
return Promise.resolve();
138
}
149

src/app/entry.server.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ import { ServerRouter } from 'react-router';
1010

1111
export const streamTimeout = 5_000;
1212

13-
// if (process.env.NODE_ENV === 'development') {
14-
// server.listen({ onUnhandledRequest: 'bypass' });
15-
// }
16-
1713
export default function handleRequest(
1814
request: Request,
1915
responseStatusCode: number,

src/app/provider/StompProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const StompContext = createContext<StompContextType | null>(null);
1616
export default function StompProvider({
1717
children,
1818
brokerURL,
19-
}: StompProviderProps) {
19+
}: Readonly<StompProviderProps>) {
2020
const [stompClient, setStompClient] = useState<Client | null>(null);
2121
const [isConnected, setIsConnected] = useState(false);
2222

src/app/provider/UserInfoProvider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ type UserIdProviderProps = {
1818

1919
export const UserIdContext = createContext<UserInfoContextType | null>(null);
2020

21-
export default function UserIdProvider({ children }: UserIdProviderProps) {
21+
export default function UserIdProvider({
22+
children,
23+
}: Readonly<UserIdProviderProps>) {
2224
const [userId, setUserId] = useState<UserInfoContextType['userId'] | null>(
2325
null,
2426
);

src/app/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function meta() {
5757
];
5858
}
5959

60-
export function Layout({ children }: { children: React.ReactNode }) {
60+
export function Layout({ children }: Readonly<{ children: React.ReactNode }>) {
6161
return (
6262
<html lang="en">
6363
<head>

src/app/routes/callback.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import ApiClient from '~/shared/api/httpClient';
88
import { useUserId } from '../provider/UserInfoProvider';
99

1010
export async function loader({ request }: LoaderFunctionArgs) {
11-
const rawCookie = request.headers.get('Cookie');
12-
const cookies = cookie.parse(rawCookie || '');
11+
const rawCookie = request.headers.get('Cookie') ?? '';
12+
const cookies = cookie.parse(rawCookie);
1313
const isAccessTokenExists = !!cookies.access_token;
1414

1515
if (!isAccessTokenExists) {
@@ -18,7 +18,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
1818

1919
const response = await ApiClient.get<UserInfoResponse>('api/userinfo', {
2020
headers: {
21-
Cookie: rawCookie || '',
21+
Cookie: rawCookie,
2222
},
2323
});
2424

src/app/routes/trade.$ticker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function TradeRouteComponent({
4444
loaderData,
4545
}: Route.ComponentProps) {
4646
const { userId } = useUserId();
47-
useTradeNotification(userId || 0);
47+
useTradeNotification(userId ?? 0);
4848
const [isMenuOpen, setIsMenuOpen] = useState(false);
4949
const { coinInfo, coinList, isLoggedIn } = loaderData;
5050
const coinListWithIcon = coinList.map((coinInfo) => ({

src/features/auth/ui/KakaoLoginButton/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { IconKakao } from '~/assets/svgs';
22

33
export default function KakaoLoginButton() {
4-
//TODO: 카카오 로그인 URL 교체할 것
54
return (
65
<a
76
href={import.meta.env.VITE_OAUTH_URL}

src/features/chat/ui/ChatButton/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ const buttonVariant = {
1717
},
1818
};
1919

20-
export default function ChatButton({ isOpen, handleClick }: ChatButtonProps) {
20+
export default function ChatButton({
21+
isOpen,
22+
handleClick,
23+
}: Readonly<ChatButtonProps>) {
2124
return (
2225
<motion.button
2326
key="chat-button"

src/features/chat/ui/ChatWindow/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function ChatWindow({
8282
handleInputValueChange: onInputValueChange,
8383
handleSubmit,
8484
handleClose,
85-
}: ChatWindowProps) {
85+
}: Readonly<ChatWindowProps>) {
8686
const containerRef = useRef<HTMLDivElement>(null);
8787
const { height } = useDimensions(containerRef);
8888
const disabled = state === 'processing' || state === 'complete';

0 commit comments

Comments
 (0)