Skip to content

Commit

Permalink
๐Ÿ“ฆ Chore: ํ”„๋กœ์ ํŠธ ์ดˆ๊ธฐ ์„ธํŒ…
Browse files Browse the repository at this point in the history
eslint
  - type import ๊ตฌ๋ถ„์„ ์œ„ํ•œ consistent-type-imoprts ์„ค์น˜ ๋ฐ ์ ์šฉ

package.json
  - next lint --fix ๊ตฌ๋ฌธ ์ถ”๊ฐ€

์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ํŒŒ์ผ ์‚ญ์ œ
  - global.css
  - Home.moudle.css

ํ”„๋กœ์ ํŠธ์— ํ•„์š”ํ•œ ํด๋” ๊ตฌ์กฐ ์ƒ์„ฑ ๋ฐ sample ํŒŒ์ผ ์ถ”๊ฐ€

_app.tsx์— react-query ์ดˆ๊ธฐ ์„ค์ •

eslint rule no-unused-vars ์ œ๊ฑฐ์—์„œ ์ ์šฉ์œผ๋กœ ๋ณ€๊ฒฝ ํ›„ sample.ts ์ˆ˜์ •

git hook ์šด์˜์ฒด์ œ ๊ฐ„ ์ด์Šˆ๋กœ ์ธํ•ด husky ์ˆ˜์ •
์ฐธ์กฐ: (typicode/husky#1177)
  • Loading branch information
aggie97 committed Jul 28, 2023
1 parent ceabd96 commit 7214666
Show file tree
Hide file tree
Showing 28 changed files with 294 additions and 456 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"error",
{ "allowSameFolder": true }
],
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error"
"simple-import-sort/exports": "error",
"@typescript-eslint/consistent-type-imports": "error"
}
}
Empty file modified .husky/pre-commit
100644 โ†’ 100755
Empty file.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint --cache",
"lint": "next lint",
"lint:fix": "next lint --fix --dir \"./src\"",
"format": "prettier --cache --write \"./src/**/*.{ts,tsx,js,jsx}\"",
"prepare": "husky install",
"test": "jest --coverage",
Expand Down Expand Up @@ -46,7 +47,7 @@
"eslint-plugin-unused-imports": "^3.0.0",
"jest": "^29.6.1",
"jest-environment-jsdom": "^29.6.1",
"husky": "^8.0.3",
"husky": "^8.0.3",
"lint-staged": "^13.2.3",
"typescript": "^4.9.5"
},
Expand Down
7 changes: 7 additions & 0 deletions src/components/common/layout/body/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { type FC, type PropsWithChildren } from "react";

const Body: FC<PropsWithChildren> = ({ children }) => {
return <div>{children}</div>;
};

export default Body;
5 changes: 5 additions & 0 deletions src/components/common/layout/footer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Footer = () => {
return <footer>footer</footer>;
};

export default Footer;
5 changes: 5 additions & 0 deletions src/components/common/layout/header/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Header = () => {
return <header>header</header>;
};

export default Header;
17 changes: 17 additions & 0 deletions src/components/common/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { FC, PropsWithChildren } from "react";

import Body from "./body";
import Footer from "./footer";
import Header from "./header";

const Layout: FC<PropsWithChildren> = ({ children }) => {
return (
<>
<Header />
<Body>{children}</Body>
<Footer />
</>
);
};

export default Layout;
5 changes: 5 additions & 0 deletions src/components/contest/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ContestList = () => {
return <div>ํ•ด์ปคํ†ค/๊ณต๋ชจ์ „ ๋ชฉ๋ก ํŽ˜์ด์ง€</div>;
};

export default ContestList;
5 changes: 5 additions & 0 deletions src/components/project/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ProjectList = () => {
return <div>ํ”„๋กœ์ ํŠธ ๋ชฉ๋ก ํŽ˜์ด์ง€</div>;
};

export default ProjectList;
5 changes: 5 additions & 0 deletions src/components/userInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const UserInfo = () => {
return <div>ํ”„๋กœํ•„ ํŽ˜์ด์ง€</div>;
};

export default UserInfo;
3 changes: 3 additions & 0 deletions src/lib/apis/axiosClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import axios from "axios";

export const AxiosClient = axios.create({ baseURL: "http://sample.com" });
5 changes: 5 additions & 0 deletions src/lib/apis/sample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const getSample = () => {};
export const postSample = () => {};
export const patchSample = () => {};
export const putSample = () => {};
export const deleteSample = () => {};
3 changes: 3 additions & 0 deletions src/lib/constants/sample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const SAMPLE = {
sampleURL: "http://localhost:3000/sample",
};
7 changes: 7 additions & 0 deletions src/lib/hooks/useSample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { useState } from "react";

export const useSample = () => {
const [sample, setSample] = useState("sample!");

return [sample, setSample];
};
5 changes: 5 additions & 0 deletions src/lib/types/sample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ISample {
sample: "sample";
}

export type TSample = "sample";
3 changes: 3 additions & 0 deletions src/lib/utils/sample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const utilSample = () => {
return "sample";
};
7 changes: 7 additions & 0 deletions src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { NextPage } from "next";

const Custom404: NextPage = () => {
return <h1>404 - Page Not Found</h1>;
};

export default Custom404;
23 changes: 20 additions & 3 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
import "styles/globals.css";

import { Global } from "@emotion/react";
import {
Hydrate,
QueryClient,
QueryClientProvider,
} from "@tanstack/react-query";
import Layout from "components/common/layout";
import type { AppProps } from "next/app";
import { useState } from "react";
import { globalStyles } from "styles/globalStyles";

export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
const [queryClient] = useState(() => new QueryClient());
return (
<QueryClientProvider client={queryClient}>
<Hydrate state={pageProps.dehydratedState}>
<Global styles={globalStyles} />
<Layout>
<Component {...pageProps} />
</Layout>
</Hydrate>
</QueryClientProvider>
);
}
File renamed without changes.
5 changes: 5 additions & 0 deletions src/pages/contests/[id]/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ContestDetail = () => {
return <div>ํ•ด์ปคํ†ค/๊ณต๋ชจ์ „ ์ƒ์„ธ ํŽ˜์ด์ง€</div>;
};

export default ContestDetail;
7 changes: 7 additions & 0 deletions src/pages/contests/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import ContestList from "components/contest";

const ContestPage = () => {
return <ContestList />;
};

export default ContestPage;
118 changes: 5 additions & 113 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,115 +1,7 @@
/* eslint-disable react/no-unknown-property */
import { Inter } from "next/font/google";
import Head from "next/head";
import Image from "next/image";
import styles from "styles/Home.module.css";
import type { NextPage } from "next";

const inter = Inter({ subsets: ["latin"] });
const Home: NextPage = () => {
return <div>๋ฉ”์ธ ํŽ˜์ด์ง€</div>;
};

export default function Home() {
return (
<>
<Head>
<title>Create Next App</title>
<meta name="description" content="Generated by create next app" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
</Head>
<main className={`${styles.main} ${inter.className}`}>
<div className={styles.description} css={{ backgroundColor: "red" }}>
<p>
Get started by editing&nbsp;
<code className={styles.code}>src/pages/index.tsx</code>
</p>
<div>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
By{" "}
<Image
src="/vercel.svg"
alt="Vercel Logo"
className={styles.vercelLogo}
width={100}
height={24}
priority
/>
</a>
</div>
</div>

<div className={styles.center}>
<Image
className={styles.logo}
src="/next.svg"
alt="Next.js Logo"
width={180}
height={37}
priority
/>
</div>

<div className={styles.grid}>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Docs <span>-&gt;</span>
</h2>
<p>
Find in-depth information about Next.js features and&nbsp;API.
</p>
</a>

<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Learn <span>-&gt;</span>
</h2>
<p>
Learn about Next.js in an interactive course with&nbsp;quizzes!
</p>
</a>

<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Templates <span>-&gt;</span>
</h2>
<p>
Discover and deploy boilerplate example Next.js&nbsp;projects.
</p>
</a>

<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
target="_blank"
rel="noopener noreferrer"
>
<h2>
Deploy <span>-&gt;</span>
</h2>
<p>
Instantly deploy your Next.js site to a shareable URL
with&nbsp;Vercel.
</p>
</a>
</div>
</main>
</>
);
}
export default Home;
5 changes: 5 additions & 0 deletions src/pages/projects/[id]/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ProjectDetail = () => {
return <div>ํ”„๋กœ์ ํŠธ/์Šคํ„ฐ๋”” ์ƒ์„ธ ํŽ˜์ด์ง€</div>;
};

export default ProjectDetail;
8 changes: 8 additions & 0 deletions src/pages/projects/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import ProjectList from "components/project";
import type { NextPage } from "next";

const ProjectPage: NextPage = () => {
return <ProjectList />;
};

export default ProjectPage;
8 changes: 8 additions & 0 deletions src/pages/userInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import UserInfo from "components/userInfo";
import type { NextPage } from "next";

const UserInfoPage: NextPage = () => {
return <UserInfo />;
};

export default UserInfoPage;
Loading

0 comments on commit 7214666

Please sign in to comment.