Skip to content

Commit 83b040b

Browse files
committed
feat: githubAction
1 parent 704071d commit 83b040b

File tree

6 files changed

+91
-12
lines changed

6 files changed

+91
-12
lines changed

.github/workflows/lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Commit Message Check on PR and Main Push
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [20]
16+
steps:
17+
- name: Checkout 🛎️
18+
uses: actions/checkout@v3
19+
with:
20+
persist-credentials: false
21+
22+
- name: Install PNPM
23+
uses: pnpm/action-setup@v2
24+
with:
25+
version: 9.4.0
26+
27+
- name: Install Deps
28+
run: pnpm i --no-frozen-lockfile
29+
30+
- name: Format
31+
run: |
32+
pnpm run format:ci
33+
34+
- name: Lint
35+
run: pnpm run lint:ci

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist/
2+
node_modules/
3+
.next/
4+
pnpm-lock.yaml
5+
package-lock.json

.prettierrc

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

package-lock.json

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

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
"build": "next build",
88
"start": "next start",
99
"lint": "eslint \"src/**/*.{js,ts,jsx,tsx}\" --fix",
10+
"lint:ci": "eslint \"src/**/*.{js,ts,jsx,tsx}\"",
11+
"format": "prettier --write .",
12+
"format:ci": "prettier --list-different \"**/*.{ts,tsx,js,jsx}\"",
1013
"prepare": "husky"
1114
},
1215
"dependencies": {
16+
"@types/prettier": "^3.0.0",
1317
"next": "14.2.15",
18+
"prettier": "3.3.2",
1419
"react": "^18",
1520
"react-dom": "^18"
1621
},

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)