Skip to content

Commit

Permalink
No ESLint warnings or errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deipanema committed Oct 24, 2024
1 parent 1076190 commit b816f87
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 20 deletions.
12 changes: 7 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"eslint": "^8.57.1",
"eslint-config-next": "14.2.14",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
"jsdom": "^25.0.1",
"npm-run-all": "^4.1.5",
"postcss": "^8",
Expand Down
5 changes: 3 additions & 2 deletions src/api/noteAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export default async function deleteNote(noteId: number) {
try {
const response = await api.delete(`notes/${noteId}`);
return response.data;
} catch (e) {
const error = e as ErrorType;
} catch (error) {
const axiosError = error as AxiosError<ErrorType>;
console.error(axiosError.message);
}
}
3 changes: 2 additions & 1 deletion src/app/(auth)/components/LoginPrompt.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AnimatedText from "@/utils/AnimatedText";
import Link from "next/link";

import AnimatedText from "@/utils/AnimatedText";

export default function LoginPrompt() {
return (
<div className="mb-6 flex justify-center gap-x-1 text-xs sm:gap-x-[10px] sm:text-sm">
Expand Down
3 changes: 2 additions & 1 deletion src/app/(auth)/components/SignupPrompt.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import AnimatedText from "@/utils/AnimatedText";
import Link from "next/link";

import AnimatedText from "@/utils/AnimatedText";

export default function SignupPrompt() {
return (
<div className="mb-6 flex justify-center gap-x-1 text-xs sm:gap-x-[10px] sm:text-sm">
Expand Down
1 change: 1 addition & 0 deletions src/app/dashboard/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default function SideBar() {

queryClient.invalidateQueries({ queryKey: ["goals"] });
} catch (error) {
console.error(error);
toast.error("새로운 목표가 추가되지 않았습니다.");
}
};
Expand Down
8 changes: 4 additions & 4 deletions src/app/dashboard/components/TodoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";

import { getGoal } from "@/api/goalAPI";
import useModal from "@/hook/useModal";
import CreateNewTodo from "@/components/CreateNewTodo";
import { getTodos } from "@/api/todoAPI";
import { useTodoStore } from "@/store/todoStore";
import { GoalType, TodoType } from "@/app/types/todoGoalType";
import useModal from "@/hook/useModal";
import CreateNewTodo from "@/components/CreateNewTodo";

import ProgressBar from "./ProgressBar";
import TodoItem from "./TodoItem";
import { useTodoStore } from "@/store/todoStore";
import ProgressBar from "./ProgressBar";

export type TodoCardProps = {
id: number;
Expand Down
4 changes: 3 additions & 1 deletion src/app/dashboard/components/TodoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import CreateNewTodo from "@/components/CreateNewTodo";
import { getNotes } from "@/api/noteAPI";
import { NoteType, TodoType } from "@/app/types/todoGoalType";
import { deleteTodo, toggleTodo } from "@/api/todoAPI";
import { useTodoStore } from "@/store/todoStore";

import NoteViewer from "./NoteViewer";
import { useTodoStore } from "@/store/todoStore";

type TodoProps = {
todo: TodoType;
Expand Down Expand Up @@ -66,6 +66,8 @@ export default function TodoItem({ todo, isTodoCardRelated = true, inTodoCard }:

useEffect(() => {
loadNoteContent();

// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/goal/[goalId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import { AxiosError } from "axios";
import { deleteGoal, ErrorType, getGoal } from "@/api/goalAPI";
import { getTodos } from "@/api/todoAPI";
import useModal from "@/hook/useModal";
import { useTodoStore } from "@/store/todoStore";
import CreateNewTodo from "@/components/CreateNewTodo";
import EditGoalTitleModal from "@/components/EditGoalTitleModal";
import { GoalType, TodoType } from "@/app/types/todoGoalType";
import { useGoalStore } from "@/store/goalStore";

import ProgressBar from "../../components/ProgressBar";
import TodoItem from "../../components/TodoItem";
import { useTodoStore } from "@/store/todoStore";

type GoalPageProps = {
params: { goalId: string; title: string };
Expand Down
2 changes: 2 additions & 0 deletions src/app/dashboard/note/[noteId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export default function NotePage() {

useEffect(() => {
loadNoteData();

// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const handleTitleChange = (e: ChangeEvent<HTMLInputElement>) => {
Expand Down
6 changes: 3 additions & 3 deletions src/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import { useEffect, useState } from "react";
import { useInfiniteQuery } from "@tanstack/react-query";
import { useInView } from "react-intersection-observer";

import LoadingSpinner from "@/components/LoadingSpinner";
import LoadingScreen from "@/components/LoadingScreen";
import { getInfinityScrollGoals } from "@/api/goalAPI";
import { getAllTodos } from "@/api/todoAPI";
import { useTodoStore } from "@/store/todoStore";
import LoadingSpinner from "@/components/LoadingSpinner";
import LoadingScreen from "@/components/LoadingScreen";

import { GoalType, TodoType } from "../types/todoGoalType";

import TodoCard from "./components/TodoCard";
import ProgressTracker from "./components/ProgressTracker";
import TodoItem from "./components/TodoItem";
import { useTodoStore } from "@/store/todoStore";

export default function DashboardPage() {
const { isUpdated } = useTodoStore();
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/todoboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import { useEffect, useState } from "react";

import { useTodoStore } from "@/store/todoStore";
import CreateNewTodo from "@/components/CreateNewTodo";
import useModal from "@/hook/useModal";
import { getAllTodos } from "@/api/todoAPI";
import { TodoType } from "@/app/types/todoGoalType";

import TodoItem from "../components/TodoItem";
import { useTodoStore } from "@/store/todoStore";

type StatusType = "All" | "Todo" | "Done";

Expand Down
2 changes: 1 addition & 1 deletion src/components/CreateNewTodo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import React, { useState, useRef, useEffect } from "react";
import { toast } from "react-toastify";
import Image from "next/image";

import { useTodoStore } from "@/store/todoStore";
import { createTodo, postFile, updateTodo } from "@/api/todoAPI";
import useModal from "@/hook/useModal";
import { GoalType, InitialTodoType, TodoType } from "@/app/types/todoGoalType";
import { getGoals } from "@/api/goalAPI";

import LinkUpload from "./LinkUpload";
import { useTodoStore } from "@/store/todoStore";

type CreateNewTodoProps = {
closeCreateNewTodo: () => void;
Expand Down

0 comments on commit b816f87

Please sign in to comment.