Skip to content

Commit 41f9f34

Browse files
committed
add linting and formatting workflows
1 parent 4d5b2f8 commit 41f9f34

5 files changed

Lines changed: 87 additions & 1 deletion

File tree

.github/workflows/lint-check.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Linting Check
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- develop
7+
pull_request:
8+
branches:
9+
- main
10+
- develop
11+
- 'feature/**'
12+
jobs:
13+
run-linting-check:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 22
23+
cache: 'pnpm'
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: latest
28+
- name: Install modules
29+
run: pnpm install
30+
- name: Generate Prisma client
31+
run: pnpm prisma:generate
32+
- name: Run linting check
33+
run: pnpm lint
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Prettier Check
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- develop
7+
pull_request:
8+
branches:
9+
- main
10+
- develop
11+
- "feature/**"
12+
jobs:
13+
run-prettier-check:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 22
23+
cache: "pnpm"
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: latest
28+
- name: Install modules
29+
run: pnpm install
30+
- name: Run prettier check
31+
run: pnpm prettier:check

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "none",
4+
"tabWidth": 2,
5+
"singleQuote": true,
6+
"printWidth": 125
7+
}

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "eslint"
9+
"lint": "eslint . --max-warnings=0",
10+
"lint:fix": "eslint . --fix",
11+
"prisma:generate": "prisma generate",
12+
"prettier:check": "prettier --check .",
13+
"prettier:fix": "prettier --write ."
1014
},
1115
"engines": {
1216
"node": ">= 22.0.0"
@@ -25,6 +29,7 @@
2529
"@types/react-dom": "^19",
2630
"eslint": "^9",
2731
"eslint-config-next": "15.5.2",
32+
"prettier": "^3.6.2",
2833
"tailwindcss": "^4",
2934
"typescript": "^5"
3035
}

pnpm-lock.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)