Skip to content

Commit 8699501

Browse files
committed
style: @typescript-eslint/consistent-type-imports rule 추가
1 parent c00dbe8 commit 8699501

File tree

74 files changed

+556
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+556
-84
lines changed

.eslintrc.json

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"plugin:storybook/recommended",
66
"plugin:prettier/recommended"
77
],
8+
"plugins": ["@typescript-eslint"],
89
"rules": {
910
"react/react-in-jsx-scope": "off",
1011
"no-unused-vars": "off",
@@ -36,6 +37,7 @@
3637
"newlines-between": "always"
3738
}
3839
],
40+
"@typescript-eslint/consistent-type-imports": "error",
3941
"react/button-has-type": "warn",
4042
"react/self-closing-comp": [
4143
"error",

.pnp.cjs

+277
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"@types/mapbox-gl": "^2.7.10",
7070
"@types/qs": "^6.9.7",
7171
"@types/react-lottie": "^1.2.6",
72+
"@typescript-eslint/eslint-plugin": "^6.8.0",
7273
"babel-loader": "^8.3.0",
7374
"css-loader": "^6.7.3",
7475
"eslint": "^8.33.0",

src/features/home/components/DoughnutChart/DoughnutChart.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/react';
22

33
import DoughnutChart from './DoughnutChart';
44

src/features/home/components/DrawerContents/DrawerContents.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/react';
22

33
import DrawerContents from './DrawerContents';
44

src/features/home/components/DrawerContents/DrawerContents.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { deleteUser } from '@/shared/apis/auth/delete';
66
import { Button } from '@/shared/components';
77
import useAuth from '@/shared/hooks/useAuth';
88
import useConfirm from '@/shared/hooks/useConfirm';
9-
import { Statistics } from '@/shared/types/record/statistics';
9+
import type { Statistics } from '@/shared/types/record/statistics';
1010

1111
import styles from './DrawerContents.module.scss';
1212

src/features/home/components/Map/Map.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import classNames from 'classnames/bind';
2-
import { GeoJSONSource } from 'mapbox-gl';
32
import { useEffect, useMemo, useRef, useState } from 'react';
4-
import ReactMapGL, { Layer, MapRef, Source, useMap } from 'react-map-gl';
3+
import ReactMapGL, {
4+
Layer,
5+
Source,
6+
useMap,
7+
type GeoJSONSource,
8+
type MapRef,
9+
} from 'react-map-gl';
510

611
import 'mapbox-gl/dist/mapbox-gl.css';
7-
import { Experience } from '@/shared/types/Experience';
12+
import type { Experience } from '@/shared/types/Experience';
813

914
import Slider from '../Slider';
1015

src/features/home/components/Slider/Slider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'swiper/css';
66
import AlcoholPreview from '@/features/alcohol/components/AlcoholPreview';
77
import Chip from '@/shared/components/Chip';
88
import Icon from '@/shared/components/Icon';
9-
import { Experience } from '@/shared/types/Experience';
9+
import type { Experience } from '@/shared/types/Experience';
1010

1111
import styles from './Slider.module.scss';
1212

src/features/record/components/AlcoholPercentFeelingInput/AlcoholPercentFeelingInput.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import classNames from 'classnames/bind';
2-
import { ForwardedRef, forwardRef } from 'react';
2+
import { forwardRef, type ForwardedRef } from 'react';
33

44
import Chip from '@/shared/components/Chip';
5-
import { AlcoholPercentFeeling } from '@/shared/types/record/alcoholPercentFeeling';
5+
import type { AlcoholPercentFeeling } from '@/shared/types/record/alcoholPercentFeeling';
66

77
import { getAlcoholPercentFeelingLabel } from '../../utils/getAlcoholPercentFeelingLabel';
88

src/features/record/components/DetailFlavorInput/DetailFlavorInput.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Meta, StoryFn } from '@storybook/react';
22
import { useState } from 'react';
33

4-
import { FlavorTag } from '@/shared/types/record/flavorTag';
4+
import type { FlavorTag } from '@/shared/types/record/flavorTag';
55

66
import DetailFlavorInput from './DetailFlavorInput';
77

src/features/record/components/DetailFlavorInput/DetailFlavorInput.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import classNames from 'classnames/bind';
2-
import { ForwardedRef, forwardRef } from 'react';
2+
import { forwardRef, type ForwardedRef } from 'react';
33

44
import Accordion from '@/shared/components/Accordion';
55
import Chip from '@/shared/components/Chip';
6-
import { FlavorTag } from '@/shared/types/record/flavorTag';
6+
import type { FlavorTag } from '@/shared/types/record/flavorTag';
77

88
import styles from './DetailFlavorInput.module.scss';
99
import { flavorTagOptions } from './flavorTagOptions';

src/features/record/components/DetailFlavorInput/flavorTagOptions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FLAVOR_TAGS } from '@/shared/constants/flavorTags';
2-
import { DetailTag, MajorTag } from '@/shared/types/record/flavorTag';
2+
import type { DetailTag, MajorTag } from '@/shared/types/record/flavorTag';
33

44
import {
55
getDetailFlavorTagLabel,

src/features/record/components/FlavorSliderGroup/FlavorSliderGroup.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import classNames from 'classnames/bind';
2-
import { ForwardedRef, forwardRef, useEffect, useState } from 'react';
2+
import { forwardRef, type ForwardedRef } from 'react';
33

44
import Slider from '@/shared/components/Slider';
5-
import { Record } from '@/shared/types/record';
5+
import type { Record } from '@/shared/types/record';
66

77
import styles from './FlavorSliderGroup.module.scss';
88

src/features/record/components/ImageSwiper/ImageSwiper.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import classNames from 'classnames/bind';
2-
import { useEffect, useState, ChangeEvent } from 'react';
2+
import { useEffect, useState, type ChangeEvent } from 'react';
33
import { Pagination } from 'swiper';
44
import { Swiper, SwiperSlide } from 'swiper/react';
55

src/features/record/components/Rating/Rating.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import classNames from 'classnames/bind';
22
import { isNil } from 'lodash-es';
3-
import { ForwardedRef, forwardRef, useCallback, useState } from 'react';
3+
import { forwardRef, useCallback, type ForwardedRef } from 'react';
44

55
import Icon from '@/shared/components/Icon';
66

src/features/record/hooks/useCreateRecordForm.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import dayjs from 'dayjs';
22
import { useRouter } from 'next/router';
3-
import { useForm, SubmitHandler, SubmitErrorHandler } from 'react-hook-form';
3+
import {
4+
useForm,
5+
type SubmitHandler,
6+
type SubmitErrorHandler,
7+
} from 'react-hook-form';
48

59
import { useCreateRecord } from '@/shared/apis/records/createRecord';
6-
import { Alcohol } from '@/shared/types/alcohol';
7-
import { Record } from '@/shared/types/record';
10+
import type { Alcohol } from '@/shared/types/alcohol';
11+
import type { Record } from '@/shared/types/record';
812

913
import { FLAVOR_SLIDER_GROUP_DEFAULT_VALUE } from '../components/FlavorSliderGroup/FlavorSliderGroup';
1014

src/features/record/utils/getAlcoholPercentFeelingLabel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AlcoholPercentFeeling } from '@/shared/types/record/alcoholPercentFeeling';
1+
import type { AlcoholPercentFeeling } from '@/shared/types/record/alcoholPercentFeeling';
22

33
const alcoholPercentFeelingAlias: Record<AlcoholPercentFeeling, string> = {
44
MILD: '연하다',

src/features/record/utils/getFlavorTagLabel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DetailTag, MajorTag } from '@/shared/types/record/flavorTag';
1+
import type { DetailTag, MajorTag } from '@/shared/types/record/flavorTag';
22

33
/**
44
* 맛 종류 문서: https://docs.google.com/spreadsheets/d/1HItKDWkbNg2vsrbqpdfcDhMcNnKmKkCouMeYWX3v7Bk/edit#gid=0

src/features/search/components/AlcoholCategoryTab/AlcoholCategoryTab.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import classNames from 'classnames/bind';
2-
import { Dispatch, SetStateAction } from 'react';
2+
import type { Dispatch, SetStateAction } from 'react';
33

44
import AlcoholCategoryTabItem from '@/features/search/components/AlcoholCategoryTabItem';
55
import { ALCOHOL_CATEGORIES } from '@/shared/constants/alcohol';
6-
import { AlcoholTag } from '@/shared/types/alcohol';
6+
import type { AlcoholTag } from '@/shared/types/alcohol';
77

88
import styles from './AlcoholCategoryTab.module.scss';
99

src/features/search/components/SearchBar/SearchBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import classNames from 'classnames/bind';
22
import { debounce } from 'lodash-es';
33
import {
4-
KeyboardEventHandler,
54
useCallback,
65
useEffect,
76
useMemo,
87
useState,
8+
type KeyboardEventHandler,
99
} from 'react';
1010

1111
import Icon from '@/shared/components/Icon';

src/pages/_app.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Hydrate, QueryClientProvider } from '@tanstack/react-query';
22
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
3-
import { NextPageContext } from 'next';
3+
import type { NextPageContext } from 'next';
44
import App, { type AppContext, type AppProps } from 'next/app';
55
import dynamic from 'next/dynamic';
66
import Script from 'next/script';

src/pages/api/logout.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextApiRequest, NextApiResponse } from 'next';
1+
import type { NextApiRequest, NextApiResponse } from 'next';
22

33
import { deleteAccessToken, deleteRefreshToken } from '@/shared/utils/auth';
44

src/pages/api/redirect/apple.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios';
2-
import { NextApiRequest, NextApiResponse } from 'next';
2+
import type { NextApiRequest, NextApiResponse } from 'next';
33

44
import {
55
NEXT_PUBLIC_API_BASE_URI,

src/pages/api/redirect/kakao.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios';
2-
import { NextApiRequest, NextApiResponse } from 'next';
2+
import type { NextApiRequest, NextApiResponse } from 'next';
33

44
import {
55
NEXT_PUBLIC_API_BASE_URI,

src/pages/api/refresh.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios';
2-
import { NextApiRequest, NextApiResponse } from 'next';
2+
import type { NextApiRequest, NextApiResponse } from 'next';
33

44
import {
55
ACCESS_TOKEN_KEY,

src/pages/feed/index.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
import { dehydrate, DehydratedState, QueryClient } from '@tanstack/react-query';
1+
import {
2+
dehydrate,
3+
QueryClient,
4+
type DehydratedState,
5+
} from '@tanstack/react-query';
26
import classNames from 'classnames/bind';
3-
import { GetServerSideProps } from 'next';
7+
import type { GetServerSideProps } from 'next';
48
import Link from 'next/link';
59
import { useRouter } from 'next/router';
610

@@ -11,7 +15,7 @@ import PageLayout from '@/shared/components/PageLayout';
1115
import Skeleton from '@/shared/components/Skeleton';
1216
import TopNavigator from '@/shared/components/TopNavigator';
1317
import useIntersect from '@/shared/hooks/useIntersect';
14-
import { Feed } from '@/shared/types/feed';
18+
import type { Feed } from '@/shared/types/feed';
1519

1620
import styles from './index.module.scss';
1721

src/pages/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { dehydrate, QueryClient } from '@tanstack/react-query';
22
import classNames from 'classnames/bind';
3-
import { GetServerSideProps } from 'next';
3+
import type { GetServerSideProps } from 'next';
44
import dynamic from 'next/dynamic';
5-
import { MouseEvent, useMemo, useState } from 'react';
5+
import { useMemo, useState, type MouseEvent } from 'react';
66

77
import Map from '@/features/home/components/Map';
88
import AlcoholCategoryFilter from '@/features/search/components/AlcoholCategoryFilter';

src/pages/records/[id]/index.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { dehydrate, DehydratedState, QueryClient } from '@tanstack/react-query';
1+
import {
2+
dehydrate,
3+
QueryClient,
4+
type DehydratedState,
5+
} from '@tanstack/react-query';
26
import classNames from 'classnames/bind';
37
import dayjs from 'dayjs';
48
import { isNil } from 'lodash-es';
5-
import { GetServerSideProps } from 'next';
9+
import type { GetServerSideProps } from 'next';
610
import { useCallback } from 'react';
711

812
import FlavorSliderGroup from '@/features/record/components/FlavorSliderGroup';
@@ -15,9 +19,9 @@ import Icon from '@/shared/components/Icon';
1519
import PageLayout from '@/shared/components/PageLayout';
1620
import TopNavigator from '@/shared/components/TopNavigator';
1721
import useConfirm from '@/shared/hooks/useConfirm';
18-
import { Alcohol } from '@/shared/types/alcohol';
19-
import { Record } from '@/shared/types/record';
20-
import { FlavorTag } from '@/shared/types/record/flavorTag';
22+
import type { Alcohol } from '@/shared/types/alcohol';
23+
import type { Record } from '@/shared/types/record';
24+
import type { FlavorTag } from '@/shared/types/record/flavorTag';
2125

2226
import styles from './index.module.scss';
2327

src/pages/records/create/index.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
import { dehydrate, DehydratedState, QueryClient } from '@tanstack/react-query';
1+
import {
2+
type DehydratedState,
3+
dehydrate,
4+
QueryClient,
5+
} from '@tanstack/react-query';
26
import classNames from 'classnames/bind';
3-
import { GetServerSideProps } from 'next';
7+
import type { GetServerSideProps } from 'next';
48
import { useRouter } from 'next/router';
59
import { Controller } from 'react-hook-form';
610

src/shared/apis/alcohols/getAlcohol.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createQuery } from 'react-query-kit';
22

3-
import { Alcohol } from '@/shared/types/alcohol';
3+
import type { Alcohol } from '@/shared/types/alcohol';
44
import { request } from '@/shared/utils/request';
55

66
type Variables = Pick<Alcohol, 'alcoholId'>;

src/shared/apis/alcohols/searchAlcohol.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createInfiniteQuery, createQuery } from 'react-query-kit';
22

3-
import { Alcohol } from '@/shared/types/alcohol';
4-
import { PagingInfo } from '@/shared/types/paging';
3+
import type { Alcohol } from '@/shared/types/alcohol';
4+
import type { PagingInfo } from '@/shared/types/paging';
55
import { request } from '@/shared/utils/request';
66

77
type Variables = { keyword: string } & PagingInfo;

src/shared/apis/feed/getFeed.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createInfiniteQuery } from 'react-query-kit';
22

3-
import { Feed } from '@/shared/types/feed';
4-
import { PagingInfo } from '@/shared/types/paging';
3+
import type { Feed } from '@/shared/types/feed';
4+
import type { PagingInfo } from '@/shared/types/paging';
55
import { request } from '@/shared/utils/request';
66

77
type Response = {

src/shared/apis/records/createRecord.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createMutation } from 'react-query-kit';
22

3-
import { Alcohol } from '@/shared/types/alcohol';
4-
import { Record } from '@/shared/types/record';
3+
import type { Alcohol } from '@/shared/types/alcohol';
4+
import type { Record } from '@/shared/types/record';
55
import { request } from '@/shared/utils/request';
66

77
type Variables = {

src/shared/apis/records/getMyRecords.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createQuery } from 'react-query-kit';
22

3-
import { Experience } from '@/shared/types/Experience';
3+
import type { Experience } from '@/shared/types/Experience';
44
import { request } from '@/shared/utils/request';
55

66
type Response = Experience[];

src/shared/apis/records/getRecord.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createQuery } from 'react-query-kit';
22

3-
import { Alcohol } from '@/shared/types/alcohol';
4-
import { Record } from '@/shared/types/record';
3+
import type { Alcohol } from '@/shared/types/alcohol';
4+
import type { Record } from '@/shared/types/record';
55
import { request } from '@/shared/utils/request';
66

77
type Variables = Pick<Record, 'recordId'>;

src/shared/apis/records/getStatistics.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createQuery } from 'react-query-kit';
22

3-
import { Statistics } from '@/shared/types/record/statistics';
3+
import type { Statistics } from '@/shared/types/record/statistics';
44
import { request } from '@/shared/utils/request';
55

66
const getStatistics = () => {

src/shared/apis/records/searchMyRecords.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createInfiniteQuery } from 'react-query-kit';
22

3-
import { PagingInfo } from '@/shared/types/paging';
4-
import { RecordMeta } from '@/shared/types/record';
3+
import type { PagingInfo } from '@/shared/types/paging';
4+
import type { RecordMeta } from '@/shared/types/record';
55
import { generateUrl } from '@/shared/utils/generateUrl';
66
import { request } from '@/shared/utils/request';
77

src/shared/components/Accordion/Accordion.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import classNames from 'classnames/bind';
2-
import { ReactNode } from 'react';
2+
import type { ReactNode } from 'react';
33

44
import Icon from '@/shared/components/Icon';
55
import { useOpen } from '@/shared/hooks/useOpen';

src/shared/components/BottomNavigator/BottomNavigator.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meta, StoryObj } from '@storybook/react';
1+
import type { Meta, StoryObj } from '@storybook/react';
22

33
import BottomNavigator from '@/shared/components/BottomNavigator/BottomNavigator';
44

src/shared/components/BottomNavigator/BottomNavigator.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useRouter } from 'next/router';
55
import Icon from '@/shared/components/Icon';
66
import StatisticsDrawer from '@/shared/components/StatisticsDrawer';
77
import { useOpen } from '@/shared/hooks/useOpen';
8-
import { Statistics } from '@/shared/types/record/statistics';
8+
import type { Statistics } from '@/shared/types/record/statistics';
99

1010
import styles from './BottomNavigator.module.scss';
1111

0 commit comments

Comments
 (0)