Skip to content

Commit f708f54

Browse files
authored
Merge pull request Next-Room#78 from Next-Room/feat/cicd
refactor: lint/prettier/husky 적용 && CI/CD (check lint, develop push 시 자동 fork)
2 parents 8b1f8d3 + 7e656ae commit f708f54

File tree

204 files changed

+5536
-18387
lines changed

Some content is hidden

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

204 files changed

+5536
-18387
lines changed

.eslintrc.json

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,32 @@
99
"plugin:react/recommended",
1010
"plugin:@typescript-eslint/recommended",
1111
"next/core-web-vitals",
12-
"airbnb",
13-
"airbnb/hooks",
14-
"airbnb-typescript",
15-
"prettier",
16-
"plugin:storybook/recommended"
12+
"prettier"
1713
],
18-
"overrides": [],
1914
"parser": "@typescript-eslint/parser",
2015
"parserOptions": {
2116
"ecmaVersion": "latest",
2217
"sourceType": "module",
23-
"project": ["tsconfig.json"]
18+
"project": "tsconfig.json"
2419
},
2520
"plugins": ["react", "@typescript-eslint"],
21+
"globals": { "NodeJS": "readonly" },
2622
"rules": {
27-
"react/function-component-definition": [
28-
2,
23+
"import/order": [
24+
"error",
2925
{
30-
"namedComponents": [
31-
"function-declaration",
32-
"function-expression",
33-
"arrow-function"
34-
]
26+
"groups": [
27+
"builtin",
28+
"external",
29+
"internal",
30+
"parent",
31+
"sibling",
32+
"index"
33+
],
34+
"newlines-between": "always"
3535
}
3636
],
37-
"jsx-a11y/click-events-have-key-events": "off",
38-
"jsx-a11y/no-static-element-interactions": "off",
39-
"react/react-in-jsx-scope": "off",
40-
"react/jsx-props-no-spreading": "off",
41-
"jsx-a11y/label-has-associated-control": [
42-
2,
43-
{
44-
"labelAttributes": ["htmlFor"]
45-
}
46-
]
37+
"react/display-name": "off",
38+
"no-console": ["error", { "allow": ["warn", "error"] }]
4739
}
4840
}

.github/workflows/main.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Continuous Integration and Synchronization
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
push:
6+
branches:
7+
- develop
8+
9+
jobs:
10+
quality:
11+
name: Check quality
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Install dependencies
18+
run: npm install --legacy-peer-deps
19+
20+
- name: Checking
21+
run: npm run lint && npm run lint:type && npm run lint:eslint && npm run lint:prettier
22+
23+
sync:
24+
name: Sync forked repo
25+
runs-on: ubuntu-latest
26+
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
27+
28+
steps:
29+
- name: Checkout develop
30+
uses: actions/checkout@v4
31+
with:
32+
token: ${{ secrets.AUTO_ACTIONS }}
33+
fetch-depth: 0
34+
ref: develop
35+
36+
- name: Add remote-url
37+
run: |
38+
git remote add forked-repo https://lgrin-byte:${{ secrets.AUTO_ACTIONS }}@github.com/lgrin-byte/nextRoomFE
39+
git config user.name lgrin-byte
40+
git config user.email ${{ secrets.EMAIL }}
41+
42+
- name: Push changes to forked-repo
43+
run: |
44+
git push -f forked-repo develop
45+
46+
- name: Clean up
47+
run: |
48+
git remote remove forked-repo

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run lint
4+
npm run lint && npm run lint:prettier && npm run lint:eslint && npm run lint:type

.prettierignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**/*.css
2+
**/*.scss
3+
**/*.sass
4+
**/*.html
5+
**/*.yml
6+
.github
7+
.husky
8+
.next
9+
.swc
10+
.vscode

.prettierrc.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"singleQuote": false,
3-
"semi": true,
4-
"useTabs": false,
5-
"printWidth": 80
6-
}
2+
"singleQuote": false,
3+
"semi": true,
4+
"useTabs": false,
5+
"printWidth": 80
6+
}

.storybook/main.ts

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

.storybook/preview.tsx

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

app/(shared)/(ThemeTextField)/TextFieldType.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
type ValidationFunction<T> = (value: T) => string;
22

33
export type ThemeInfoTextFieldType = {
4-
id:
5-
| "title"
6-
| "timeLimit"
7-
| "hintLimit"
8-
| "progress"
9-
| "hintCode"
4+
id: "title" | "timeLimit" | "hintLimit" | "progress" | "hintCode";
105
tabIndex?: number;
116
title?: string;
127
content: string;

app/(shared)/(ThemeTextField)/useTextField.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { ChangeEvent, FocusEvent, useEffect, useRef, useState } from "react";
2+
23
import { useCreateTheme } from "@/components/atoms/createTheme.atom";
34
import { useCreateHint } from "@/components/atoms/createHint.atom";
5+
46
import { ThemeInfoTextFieldType } from "./TextFieldType";
57

68
const useTextField = ({

app/admin-new/(components)/ContentArea.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from "react";
2-
import { useModalStateValue } from "@/components/atoms/modals.atom";
32
import { useSearchParams } from "next/navigation";
3+
4+
import { useModalStateValue } from "@/components/atoms/modals.atom";
5+
46
import CreateTheme from "./CreateTheme/Container";
57
import ThemeInfo from "./ThemeInfo/Container";
68

0 commit comments

Comments
 (0)