Skip to content

Commit abc1228

Browse files
Merge pull request #237 from summerDev96/Next-배수민-sprint9
[배수민] sprint9
2 parents 8d163dd + eab9f68 commit abc1228

Some content is hidden

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

51 files changed

+8829
-2446
lines changed

.eslintrc.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// .eslintrc.js
2+
const globals = require('globals');
3+
4+
module.exports = {
5+
env: {
6+
browser: true,
7+
es2021: true,
8+
},
9+
extends: [
10+
'eslint:recommended',
11+
'plugin:import/errors',
12+
'plugin:import/warnings',
13+
'plugin:react/recommended',
14+
'plugin:react/jsx-runtime',
15+
'plugin:@typescript-eslint/recommended',
16+
'prettier',
17+
'next/core-web-vitals',
18+
],
19+
overrides: [
20+
{
21+
files: ['*.ts', '*.tsx'],
22+
parser: '@typescript-eslint/parser',
23+
parserOptions: {
24+
project: './tsconfig.json',
25+
sourceType: 'module',
26+
ecmaVersion: 'latest',
27+
ecmaFeatures: { jsx: true },
28+
},
29+
},
30+
{
31+
files: ['.eslintrc.js', 'next.config.js'],
32+
rules: {
33+
'@typescript-eslint/no-require-imports': 'off',
34+
},
35+
},
36+
],
37+
parserOptions: {
38+
ecmaVersion: 'latest',
39+
sourceType: 'module',
40+
ecmaFeatures: { jsx: true },
41+
},
42+
plugins: ['react', '@typescript-eslint', 'react-hooks', 'import', 'prettier'],
43+
globals: {
44+
...globals.browser,
45+
...globals.node,
46+
},
47+
rules: {
48+
'no-var': 'warn',
49+
'no-extra-semi': 'error',
50+
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
51+
'react-hooks/exhaustive-deps': ['warn'],
52+
'react/jsx-pascal-case': 'warn',
53+
'react/prop-types': 'off',
54+
'react-hooks/rules-of-hooks': 'error',
55+
'react/react-in-jsx-scope': 'off',
56+
'import/no-named-as-default': 'off',
57+
'import/order': [
58+
'error',
59+
{
60+
groups: [
61+
'builtin',
62+
'external',
63+
'internal',
64+
['parent', 'sibling', 'index'],
65+
'object',
66+
'type',
67+
],
68+
pathGroups: [
69+
{
70+
pattern: 'react',
71+
group: 'external',
72+
position: 'before',
73+
},
74+
{
75+
pattern: '@src/**',
76+
group: 'internal',
77+
position: 'after',
78+
},
79+
],
80+
pathGroupsExcludedImportTypes: ['react'],
81+
'newlines-between': 'always',
82+
alphabetize: { order: 'asc', caseInsensitive: true },
83+
},
84+
],
85+
'prettier/prettier': ['error', { endOfLine: 'auto' }],
86+
semi: ['error', 'always'],
87+
},
88+
};

.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: summerdev-sprint-mission
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
env:
10+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
11+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
12+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Node.js 20.17.0
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 20.x
21+
cache: npm
22+
23+
- name: Build
24+
run: |
25+
npm install
26+
npm run build
27+
28+
- name: Install Vercel CLI
29+
run: npm install -g vercel@latest
30+
31+
- name: Pull Vercel environment variables (production)
32+
run: vercel pull --yes --environment=production --token=$VERCEL_TOKEN
33+
34+
- name: Build project with Vercel
35+
run: vercel build --prod --token=$VERCEL_TOKEN
36+
37+
- name: Deploy to Vercel production
38+
run: vercel deploy --prebuilt --prod --yes --token=$VERCEL_TOKEN

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ yarn-error.log*
3333
# typescript
3434
*.tsbuildinfo
3535
next-env.d.ts
36+
37+
.vercel

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.prettierrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"tabWidth": 2,
3+
"semi": true,
4+
"singleQuote": true,
5+
"jsxSingleQuote": true,
6+
"printWidth": 100,
7+
"bracketSpacing": true,
8+
"arrowParens": "always",
9+
"proseWrap": "preserve",
10+
"trailingComma": "all",
11+
"endOfLine": "lf"
12+
}

next.config.js

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,38 @@
11
/** @type {import('next').NextConfig} */
2+
const path = require('path');
3+
24
const nextConfig = {
35
reactStrictMode: true,
4-
}
6+
webpack: (config) => {
7+
// alias 추가
8+
config.resolve.alias['@'] = path.resolve(__dirname, 'src');
9+
10+
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'));
11+
12+
config.module.rules.push(
13+
{
14+
...fileLoaderRule,
15+
test: /\.svg$/i,
16+
resourceQuery: /url/,
17+
},
18+
{
19+
test: /\.svg$/i,
20+
issuer: fileLoaderRule.issuer,
21+
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] },
22+
use: [
23+
{
24+
loader: '@svgr/webpack',
25+
options: {
26+
typescript: true,
27+
ext: 'tsx',
28+
},
29+
},
30+
],
31+
},
32+
);
33+
fileLoaderRule.exclude = /\.svg$/i;
34+
return config;
35+
},
36+
};
537

6-
module.exports = nextConfig
38+
module.exports = nextConfig;

0 commit comments

Comments
 (0)