diff --git a/.eslintrc.json b/.eslintrc.json index 39f3f467..60552981 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -38,6 +38,9 @@ "eslint-plugin-import/no-cycle": "off", "import/no-cycle":"off", "no-param-reassign":"off", + "@typescript-eslint/no-unused-vars": "warn", //사용안한 변수는 경고처리 + "react/jsx-curly-newline": "off", // jsx안에 }를 새로운 라인에 사용할 수 있다. + "@typescript-eslint/no-use-before-define": ["warn"], // 선언하기 전에 사용 한다면 경고 "jsx-a11y/label-has-associated-control": [ 2, { diff --git a/src/app/service/map/_components/bottom-sheet/BottomSheetHeader.tsx b/src/app/service/map/_components/bottom-sheet/BottomSheetHeader.tsx index 5b7a3aa3..b9da732b 100644 --- a/src/app/service/map/_components/bottom-sheet/BottomSheetHeader.tsx +++ b/src/app/service/map/_components/bottom-sheet/BottomSheetHeader.tsx @@ -1,4 +1,5 @@ /* eslint-disable import/order */ + import Image from 'next/image'; import useCss from '@/hooks/common/useCss'; import BookmarkBorderIcon from '@mui/icons-material/BookmarkBorder'; @@ -31,7 +32,7 @@ function BottomSheetHeader({ data }: BottomSheetInnerProps) { useCss('https://unpkg.com/react-spring-bottom-sheet/dist/style.css'); const onClickBookmark = () => { - console.log('====북마크 클릭, 클릭에따라 api보내야함'); + // 북마크 클릭, 클릭에따라 api보내야함 }; const addressSplit = address.split(' '); diff --git a/src/app/service/map/_components/bottom-sheet/BottomSheetInfoTab.tsx b/src/app/service/map/_components/bottom-sheet/BottomSheetInfoTab.tsx index 3f703ce6..9ed8d24f 100644 --- a/src/app/service/map/_components/bottom-sheet/BottomSheetInfoTab.tsx +++ b/src/app/service/map/_components/bottom-sheet/BottomSheetInfoTab.tsx @@ -1,3 +1,5 @@ +/* eslint-disable function-paren-newline */ + import { useToast } from '@/app/_components/ui/use-toast'; import { BottomSheetInnerProps } from '@/types/map/BottomSheetProps'; import { ChevronDown, Copy } from 'lucide-react'; diff --git a/src/app/service/map/_components/bottom-sheet/BottomSheetInner.tsx b/src/app/service/map/_components/bottom-sheet/BottomSheetInner.tsx index 68652170..fd1afb35 100644 --- a/src/app/service/map/_components/bottom-sheet/BottomSheetInner.tsx +++ b/src/app/service/map/_components/bottom-sheet/BottomSheetInner.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ import Image from 'next/image'; import OneSiteUrl from '@/app/service/map/_components/bottom-sheet/OneSiteUrl'; import BarRatingChart from '@/app/service/map/_components/chart/BarRatingChart'; diff --git a/src/app/service/map/_components/kakao/KakaoBackGroundMap.tsx b/src/app/service/map/_components/kakao/KakaoBackGroundMap.tsx index 7415e085..9b0fc751 100644 --- a/src/app/service/map/_components/kakao/KakaoBackGroundMap.tsx +++ b/src/app/service/map/_components/kakao/KakaoBackGroundMap.tsx @@ -41,7 +41,6 @@ function KakaoBackGroundMap({ lng: location.longitude, }; - console.log('mapInfo', mapInfo, mapInfo.center); return (
(''); + + const success = (position: GeolocationPosition) => { + setLocation({ + lat: position.coords.latitude, + lng: position.coords.longitude, + }); + }; + + const handleError = () => { + setLocation({ + lat: 37.483034, + lng: 126.902435, + }); + console.log('Failed to retrieve location'); + }; + + useEffect(() => { + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition(success, handleError); + } else { + handleError(); // geolocation이 없을때 에러처리 + } + }, []); + + return location; +} diff --git a/src/app/service/map/_components/kakao/Locations.tsx b/src/app/service/map/_components/kakao/Locations.tsx index 7b7ac248..209e86e6 100644 --- a/src/app/service/map/_components/kakao/Locations.tsx +++ b/src/app/service/map/_components/kakao/Locations.tsx @@ -19,7 +19,6 @@ export default function Location() { latitude: 37.483034, longitude: 126.902435, }); - console.log('Failed to retrieve location'); }; useEffect(() => { diff --git a/src/app/service/map/page.tsx b/src/app/service/map/page.tsx index 9232e15b..91b99abd 100644 --- a/src/app/service/map/page.tsx +++ b/src/app/service/map/page.tsx @@ -1,7 +1,3 @@ -/* eslint-disable react/jsx-curly-newline */ -/* eslint-disable @typescript-eslint/no-unused-vars */ -/* eslint-disable lines-around-directive */ -/* eslint-disable react/button-has-type */ 'use client'; import SearchBar from '@/app/service/map/_components/search/SearchBar'; @@ -66,7 +62,6 @@ function Page() { }; useEffect(() => { - console.log('selectId', typeof selectId, selectId); if (selectId && selectId !== 'undefined') { const selectItem = data?.data.data.filter( v => v.id === Number(selectId), @@ -86,7 +81,6 @@ function Page() { }, []); useEffect(() => { - console.log('===============', mapInfo, mapInfo.center); if (typeof location === 'object' && location !== null) { // location이 object 이고 null이 아닌지 확인 setMapInfo({ @@ -104,6 +98,7 @@ function Page() {