Skip to content

Commit b2e59ca

Browse files
authored
feat: configure husky and lint-staged (#18)
* feat: configure husky and lint-staged * chore: update config * chore: test * fix: ci workflow
1 parent e93c8ad commit b2e59ca

File tree

7 files changed

+284
-8
lines changed

7 files changed

+284
-8
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,19 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: [18.x, 20.x]
14+
node-version: [20.x, 24.x]
1515
name: Build on v${{ matrix.node-version }}
1616
steps:
1717
- uses: actions/checkout@v4
1818

1919
- name: Setup pnpm
2020
uses: pnpm/action-setup@v2
21-
with:
22-
version: latest
2321

2422
- name: Setup Node.js v${{ matrix.node-version }}
2523
uses: actions/setup-node@v4
2624
with:
2725
node-version: ${{ matrix.node-version }}
28-
cache: pnpm
26+
cache: 'pnpm'
2927

3028
- run: pnpm install --frozen-lockfile
3129
- run: pnpm build

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm pre-commit

.lintstagedrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"**/*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"],
3+
"**/*.{json,css,md}": ["prettier --write"]
4+
}

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.next
2+
.cache
3+
package-lock.json
4+
public
5+
node_modules
6+
next-env.d.ts
7+
next.config.ts
8+
yarn.lock

package.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint",
10-
"format": "prettier --write .",
11-
"typecheck": "tsc --noEmit"
10+
"lint:fix": "next lint --fix",
11+
"lint:strict": "next lint '*/**/*.{js,jsx,ts,tsx}'",
12+
"format": "prettier --write */**/*.{js,jsx,json,ts,tsx,scss,css,md}",
13+
"typecheck": "tsc --noEmit",
14+
"prepare": "husky",
15+
"pre-commit": "lint-staged"
1216
},
1317
"dependencies": {
1418
"@radix-ui/react-avatar": "^1.1.10",
@@ -34,6 +38,8 @@
3438
"@types/react-dom": "^19",
3539
"eslint": "^9",
3640
"eslint-config-next": "15.3.3",
41+
"husky": "^9.1.7",
42+
"lint-staged": "^16.1.0",
3743
"prettier": "^3.5.3",
3844
"prettier-plugin-organize-imports": "^4.1.0",
3945
"prettier-plugin-tailwindcss": "^0.6.12",
@@ -43,6 +49,6 @@
4349
},
4450
"packageManager": "pnpm@10.12.1",
4551
"engines": {
46-
"node": ">=18"
52+
"node": ">=20"
4753
}
4854
}

0 commit comments

Comments
 (0)