diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 0b45469..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "plugins": ["@typescript-eslint", "no-relative-import-paths"], - "extends": [ - "next/core-web-vitals", - "next/typescript", - "plugin:@tanstack/eslint-plugin-query/recommended", - "plugin:import/recommended", - "plugin:import/typescript" - ], - "rules": { - "no-relative-import-paths/no-relative-import-paths": [ - "error", - { - "allowSameFolder": false, - "rootDir": "", - "prefix": "@" - } - ], - "import/order": [ - "error", - { - "groups": [ - ["builtin", "external"], - "internal", - // ["parent", "sibling", "index"], - // "object", - "type" - ], - "pathGroups": [ - { - "pattern": "next", - "group": "external", - "position": "after" - }, - { - "pattern": "next/**", - "group": "external", - "position": "after" - }, - { - "pattern": "@/components", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/components/**", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/hooks", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/hooks/**", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/utils", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/utils/**", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/schema", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/schema/**", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/constants", - "group": "internal", - "position": "after" - }, - { - "pattern": "@/constants/**", - "group": "internal", - "position": "after" - } - ], - "alphabetize": { - "order": "asc" - } - } - ] - } -} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2b2199..4a0d048 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,10 +28,10 @@ jobs: - name: Install dependencies run: npm ci - # Next.js 빌드 - - name: Build Next.js app - run: npm run build - # Lint 검사 - name: Run lint run: npm run lint + + # Next.js 빌드 + - name: Build Next.js app + run: npm run build diff --git a/components/dialogs/QRCodeDialog.tsx b/components/dialogs/QRCodeDialog.tsx index 545753a..16fdf0e 100644 --- a/components/dialogs/QRCodeDialog.tsx +++ b/components/dialogs/QRCodeDialog.tsx @@ -54,6 +54,7 @@ export default function QRCodeDialog(props: { } useEffect(() => { + // eslint-disable-next-line react-hooks/set-state-in-effect setIsLoading(true); QRCode.toDataURL(props.pk, (error, url) => { diff --git a/components/forms/RegistrationForm.tsx b/components/forms/RegistrationForm.tsx index 64d6385..a58a6fc 100644 --- a/components/forms/RegistrationForm.tsx +++ b/components/forms/RegistrationForm.tsx @@ -20,7 +20,7 @@ export default function RegistrationForm() { id: "", password: "", sex: 0, - birthday: new Date(Date.now()).toISOString().split("T")[0], + birthday: new Date().toISOString().split("T")[0], contact: "", }, }); diff --git a/components/selectors/ThemeSelector.tsx b/components/selectors/ThemeSelector.tsx index 5f1215e..d3dd583 100644 --- a/components/selectors/ThemeSelector.tsx +++ b/components/selectors/ThemeSelector.tsx @@ -1,13 +1,14 @@ import { CircleHelp, MonitorCog, Moon, Sun } from "lucide-react"; import { useTheme } from "next-themes"; -import { useEffect, useMemo, useState } from "react"; +import { useMemo } from "react"; import Select from "@/components/selectors/Select"; +import useIsClient from "@/hooks/useIsClient"; import { THEME_OPTIONS } from "@/constants/options"; export default function ThemeSelector() { const { theme, setTheme } = useTheme(); - const [isClient, setIsClient] = useState(false); + const isClient = useIsClient(); const IconComponent = useMemo(() => { if (theme === "light") { @@ -20,10 +21,6 @@ export default function ThemeSelector() { return CircleHelp; }, [theme]); - useEffect(() => { - setIsClient(true); - }, []); - return (