Skip to content

Commit

Permalink
feat: prettier import order 플러그인 추가 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
son-daehyeon authored Sep 15, 2024
1 parent 88fd4b3 commit 46fe4ff
Show file tree
Hide file tree
Showing 26 changed files with 192 additions and 26 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@eslint/js": "^9.8.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__js": "^8.42.3",
"@types/js-cookie": "^3.0.6",
Expand Down
19 changes: 19 additions & 0 deletions prettier.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,23 @@ export default {
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
plugins: ['@trivago/prettier-plugin-sort-imports'],
importOrder: [
'^react',
'^next',

'^@/app',
'^@/component',
'^@/context',
'^@/store',
'^@/hook',
'^@/api',
'^@/style',

'^[./]',

'<THIRD_PARTY_MODULES>',
],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
};
2 changes: 1 addition & 1 deletion src/api/WinkApi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WinkApiRequest, Activity, Auth, Member, MemberAdmin } from '@/api';
import { Activity, Auth, Member, MemberAdmin, WinkApiRequest } from '@/api';

export class WinkApi {
private static instance: WinkApi | null = null;
Expand Down
6 changes: 3 additions & 3 deletions src/api/WinkApiApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import React, { useEffect } from 'react';

import { Loading } from '@/components';

import { WinkApi } from '@/api';
import { Loading } from '@/component';

import { useApplicationState } from '@/store';

import { WinkApi } from '@/api';

interface WinkApiApplicationProps {
children: React.ReactNode;
}
Expand Down
7 changes: 4 additions & 3 deletions src/api/request/WinkApiRequest.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import Cookies from 'js-cookie';
import { toast } from 'react-toastify';

import { RefreshResponseDto, MyInfoResponseDto } from '@/api';
import { useApplicationState, useMemberStore } from '@/store';

import { MyInfoResponseDto, RefreshResponseDto } from '@/api';

import { useMemberStore, useApplicationState } from '@/store';
import Cookies from 'js-cookie';

interface WinkRawApiResponse<T> {
code: number;
Expand Down
7 changes: 4 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

import React from 'react';
import { Bounce, ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

import { usePathname } from 'next/navigation';

import { Footer, Header } from '@/component';

import { WinkApiApplication } from '@/api';
import { Header, Footer } from '@/components';

import '@/styles/globals.css';
import 'react-toastify/dist/ReactToastify.css';
import '@/style/globals.css';

interface RootLayoutProps {
children: React.ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { toast } from 'react-toastify';
import Link from 'next/link';
import { useRouter } from 'next/navigation';

import { Button, WebInKookmin, FormContainer, TextField, Fields } from '@/components';
import { Button, Fields, FormContainer, TextField, WebInKookmin } from '@/component';

import { useForm } from '@/hook';

Expand Down
2 changes: 1 addition & 1 deletion src/app/project/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useState } from 'react';

import { Carousel, ProjectCard } from '@/components';
import { Carousel, ProjectCard } from '@/component';

interface Project {
id: number;
Expand Down
6 changes: 3 additions & 3 deletions src/app/signup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { toast } from 'react-toastify';
import Link from 'next/link';
import { useRouter } from 'next/navigation';

import { Button, WebInKookmin, Fields, FormContainer, TextField } from '@/components';

import { WinkApi } from '@/api';
import { Button, Fields, FormContainer, TextField, WebInKookmin } from '@/component';

import { useForm } from '@/hook';

import { WinkApi } from '@/api';

import * as yup from 'yup';

type Inputs =
Expand Down
2 changes: 1 addition & 1 deletion src/app/study/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { useState } from 'react';

import { StudyCard } from '@/components';
import { StudyCard } from '@/component';

interface StudyType {
id: number; // 유니크한 ID
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/Carousel.tsx → src/component/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import React, { useEffect, useRef, useState } from 'react';

import '@/styles/Carousel.css';
import '@/style/Carousel.css';

interface CarouselCard {
id: number;
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/components/Header.tsx → src/component/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import Image from 'next/image';
import Link from 'next/link';
import { usePathname } from 'next/navigation';

import { WinkApi } from '@/api';

import { useMemberStore } from '@/store';

import { WinkApi } from '@/api';

import logo from '@/public/logo.png';

export const Header: React.FC = () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/store/useMemberStore.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { create } from 'zustand';

import { MemberType } from '@/api';

import { create } from 'zustand';

interface MemberState {
member: MemberType | null;
setMember: (member: MemberType | null) => void;
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 46fe4ff

Please sign in to comment.