Skip to content

Commit 6056a9e

Browse files
committedMar 4, 2023
ESLint, Prettier 설정 추가
1 parent d3309f1 commit 6056a9e

19 files changed

+1827
-706
lines changed
 

‎.eslintignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/node_modules
2+
/.pnp
3+
.pnp.js
4+
5+
/coverage
6+
7+
/.next/
8+
/out/
9+
10+
/build
11+
12+
.DS_Store
13+
*.pem
14+
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
.pnpm-debug.log*
19+
20+
.env*.local
21+
22+
.vercel
23+
24+
*.tsbuildinfo
25+
next-env.d.ts
26+
27+
.idea
28+
.vscode
29+
30+
*.config.js

‎.eslintrc.json

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
11
{
2-
"extends": "next/core-web-vitals"
2+
"extends": [
3+
"airbnb",
4+
"airbnb-typescript",
5+
"next/core-web-vitals",
6+
"plugin:import/recommended",
7+
"plugin:react/recommended",
8+
"plugin:react-hooks/recommended",
9+
"plugin:jsx-a11y/recommended",
10+
"plugin:prettier/recommended"
11+
],
12+
"plugins": [
13+
"simple-import-sort",
14+
"sort-destructure-keys",
15+
"sort-keys-fix",
16+
"typescript-sort-keys"
17+
],
18+
"parserOptions": {
19+
"project": "./tsconfig.json"
20+
},
21+
"rules": {
22+
"simple-import-sort/imports": "error",
23+
"simple-import-sort/exports": "error",
24+
25+
"sort-destructure-keys/sort-destructure-keys": "error",
26+
27+
"sort-keys-fix/sort-keys-fix": "error",
28+
29+
"typescript-sort-keys/interface": "error",
30+
"typescript-sort-keys/string-enum": "error",
31+
32+
"react/react-in-jsx-scope": "off"
33+
}
334
}

‎.gitignore

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,32 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
41
/node_modules
52
/.pnp
63
.pnp.js
74

8-
# testing
95
/coverage
106

11-
# next.js
127
/.next/
138
/out/
149

15-
# production
1610
/build
1711

18-
# misc
1912
.DS_Store
2013
*.pem
2114

22-
# debug
2315
npm-debug.log*
2416
yarn-debug.log*
2517
yarn-error.log*
2618
.pnpm-debug.log*
2719

28-
# local env files
2920
.env*.local
3021

31-
# vercel
3222
.vercel
3323

34-
# typescript
3524
*.tsbuildinfo
3625
next-env.d.ts
26+
27+
.idea
28+
.vscode
29+
30+
public/robots.txt
31+
public/sitemap.xml
32+
public/sitemap-*.xml

‎.prettierignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/node_modules
2+
/.pnp
3+
.pnp.js
4+
5+
/coverage
6+
7+
/.next/
8+
/out/
9+
10+
/build
11+
12+
.DS_Store
13+
*.pem
14+
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
.pnpm-debug.log*
19+
20+
.env*.local
21+
22+
.vercel
23+
24+
*.tsbuildinfo
25+
next-env.d.ts
26+
27+
.idea
28+
.vscode

‎.prettierrc.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"singleAttributePerLine": true
4+
}

‎README.md

+8-36
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,10 @@
1-
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
1+
# Nextjs Boilerplate
22

3-
## Getting Started
3+
## Features
44

5-
First, run the development server:
6-
7-
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
```
14-
15-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
16-
17-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
18-
19-
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
20-
21-
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
22-
23-
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
24-
25-
## Learn More
26-
27-
To learn more about Next.js, take a look at the following resources:
28-
29-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
30-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
31-
32-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
33-
34-
## Deploy on Vercel
35-
36-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
37-
38-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
5+
- Nextjs
6+
- Typescript
7+
- Eslint
8+
- Prettier
9+
- Husky
10+
- Lint staged

‎next-sitemap.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('next-sitemap').IConfig} */
2+
module.exports = {
3+
siteUrl: 'https://example.com', // FIXME: Change to the production URL
4+
generateRobotsTxt: true,
5+
};

‎next.config.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
const withBundleAnalyzer = require('@next/bundle-analyzer')({
2+
enabled: process.env.ANALYZE === 'true',
3+
});
4+
15
/** @type {import('next').NextConfig} */
26
const nextConfig = {
37
experimental: {
48
appDir: true,
59
},
6-
}
10+
};
711

8-
module.exports = nextConfig
12+
module.exports = withBundleAnalyzer(nextConfig);

‎package-lock.json

+1,633-160
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+32-8
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,41 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint"
9+
"lint": "next lint",
10+
"postbuild": "next-sitemap",
11+
"analyze": "ANALYZE=true next build"
1012
},
1113
"dependencies": {
12-
"@types/node": "18.14.6",
13-
"@types/react": "18.0.28",
14-
"@types/react-dom": "18.0.11",
15-
"eslint": "8.35.0",
16-
"eslint-config-next": "13.2.3",
1714
"next": "13.2.3",
15+
"next-seo": "^5.15.0",
16+
"next-sitemap": "^4.0.1",
1817
"react": "18.2.0",
19-
"react-dom": "18.2.0",
20-
"typescript": "4.9.5"
18+
"react-dom": "18.2.0"
19+
},
20+
"optionalDependencies": {
21+
"@next/bundle-analyzer": "^13.2.3",
22+
"@typescript-eslint/eslint-plugin": "^5.54.0",
23+
"@typescript-eslint/parser": "^5.54.0",
24+
"eslint": "^8.35.0",
25+
"eslint-config-airbnb": "^19.0.4",
26+
"eslint-config-airbnb-typescript": "^17.0.0",
27+
"eslint-config-next": "^13.2.3",
28+
"eslint-config-prettier": "^8.6.0",
29+
"eslint-plugin-import": "^2.27.5",
30+
"eslint-plugin-jsx-a11y": "^6.7.1",
31+
"eslint-plugin-prettier": "^4.2.1",
32+
"eslint-plugin-react": "^7.32.2",
33+
"eslint-plugin-react-hooks": "^4.6.0",
34+
"eslint-plugin-simple-import-sort": "^10.0.0",
35+
"eslint-plugin-sort-destructure-keys": "^1.5.0",
36+
"eslint-plugin-sort-keys-fix": "^1.1.2",
37+
"eslint-plugin-typescript-sort-keys": "^2.1.0",
38+
"prettier": "^2.8.4"
39+
},
40+
"devDependencies": {
41+
"@types/node": "^18.14.6",
42+
"@types/react": "^18.0.28",
43+
"@types/react-dom": "^18.0.11",
44+
"typescript": "^4.9.5"
2145
}
2246
}

‎public/next.svg

-1
This file was deleted.

‎public/thirteen.svg

-1
This file was deleted.

‎public/vercel.svg

-1
This file was deleted.

‎src/app/api/hello/route.ts

-3
This file was deleted.

‎src/app/globals.css

-107
This file was deleted.

‎src/app/layout.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
import './globals.css'
2-
31
export const metadata = {
4-
title: 'Create Next App',
52
description: 'Generated by create next app',
6-
}
3+
title: 'Create Next App',
4+
};
75

86
export default function RootLayout({
97
children,
108
}: {
11-
children: React.ReactNode
9+
children: React.ReactNode;
1210
}) {
1311
return (
1412
<html lang="en">
1513
<body>{children}</body>
1614
</html>
17-
)
15+
);
1816
}

‎src/app/page.module.css

-271
This file was deleted.

‎src/app/page.tsx

+3-87
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,7 @@
1-
import Image from 'next/image'
2-
import { Inter } from 'next/font/google'
3-
import styles from './page.module.css'
4-
5-
const inter = Inter({ subsets: ['latin'] })
6-
71
export default function Home() {
82
return (
9-
<main className={styles.main}>
10-
<div className={styles.description}>
11-
<p>
12-
Get started by editing&nbsp;
13-
<code className={styles.code}>src/app/page.tsx</code>
14-
</p>
15-
<div>
16-
<a
17-
href="https://vercel.com?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
18-
target="_blank"
19-
rel="noopener noreferrer"
20-
>
21-
By{' '}
22-
<Image
23-
src="/vercel.svg"
24-
alt="Vercel Logo"
25-
className={styles.vercelLogo}
26-
width={100}
27-
height={24}
28-
priority
29-
/>
30-
</a>
31-
</div>
32-
</div>
33-
34-
<div className={styles.center}>
35-
<Image
36-
className={styles.logo}
37-
src="/next.svg"
38-
alt="Next.js Logo"
39-
width={180}
40-
height={37}
41-
priority
42-
/>
43-
<div className={styles.thirteen}>
44-
<Image src="/thirteen.svg" alt="13" width={40} height={31} priority />
45-
</div>
46-
</div>
47-
48-
<div className={styles.grid}>
49-
<a
50-
href="https://beta.nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
51-
className={styles.card}
52-
target="_blank"
53-
rel="noopener noreferrer"
54-
>
55-
<h2 className={inter.className}>
56-
Docs <span>-&gt;</span>
57-
</h2>
58-
<p className={inter.className}>
59-
Find in-depth information about Next.js features and API.
60-
</p>
61-
</a>
62-
63-
<a
64-
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
65-
className={styles.card}
66-
target="_blank"
67-
rel="noopener noreferrer"
68-
>
69-
<h2 className={inter.className}>
70-
Templates <span>-&gt;</span>
71-
</h2>
72-
<p className={inter.className}>Explore the Next.js 13 playground.</p>
73-
</a>
74-
75-
<a
76-
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
77-
className={styles.card}
78-
target="_blank"
79-
rel="noopener noreferrer"
80-
>
81-
<h2 className={inter.className}>
82-
Deploy <span>-&gt;</span>
83-
</h2>
84-
<p className={inter.className}>
85-
Instantly deploy your Next.js site to a shareable URL with Vercel.
86-
</p>
87-
</a>
88-
</div>
3+
<main>
4+
<h1>Next.js + TypeScript + Tailwind CSS</h1>
895
</main>
90-
)
6+
);
917
}

‎tsconfig.json

+35-11
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,51 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
43
"lib": ["dom", "dom.iterable", "esnext"],
5-
"allowJs": true,
6-
"skipLibCheck": true,
7-
"strict": true,
8-
"forceConsistentCasingInFileNames": true,
9-
"noEmit": true,
10-
"esModuleInterop": true,
114
"module": "esnext",
125
"moduleResolution": "node",
136
"resolveJsonModule": true,
14-
"isolatedModules": true,
7+
"removeComments": true,
8+
"preserveConstEnums": true,
9+
"strict": true,
10+
"alwaysStrict": true,
11+
"strictNullChecks": true,
12+
"noUncheckedIndexedAccess": true,
13+
14+
"noImplicitAny": true,
15+
"noImplicitReturns": true,
16+
"noImplicitThis": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
19+
"allowUnreachableCode": false,
20+
"noFallthroughCasesInSwitch": true,
21+
22+
"target": "es5",
23+
"outDir": "out",
24+
"declaration": true,
25+
"sourceMap": true,
26+
27+
"esModuleInterop": true,
28+
"allowSyntheticDefaultImports": true,
29+
"allowJs": false,
30+
"skipLibCheck": true,
31+
"forceConsistentCasingInFileNames": true,
32+
33+
1534
"jsx": "preserve",
35+
"noEmit": true,
36+
"isolatedModules": true,
1637
"incremental": true,
38+
39+
"baseUrl": ".",
40+
"paths": {
41+
"@/*": ["./src/*"]
42+
},
43+
1744
"plugins": [
1845
{
1946
"name": "next"
2047
}
2148
],
22-
"paths": {
23-
"@/*": ["./src/*"]
24-
}
2549
},
2650
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
2751
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)
Please sign in to comment.