Skip to content

Commit ff3cc3d

Browse files
committed
husky, lint-staged 설정
1 parent 4adf072 commit ff3cc3d

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx lint-staged --concurrent false

lint-staged.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'eslint'],
3+
'*.{json,yaml}': ['prettier --write'],
4+
'**/*.ts?(x)': () => 'npm run check',
5+
};

package-lock.json

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"start": "next start",
99
"lint": "next lint",
1010
"postbuild": "next-sitemap",
11-
"analyze": "ANALYZE=true next build"
11+
"analyze": "ANALYZE=true next build",
12+
"check": "tsc --noEmit --pretty",
13+
"prepare": "husky install"
1214
},
1315
"dependencies": {
1416
"next": "13.2.3",
@@ -35,6 +37,7 @@
3537
"eslint-plugin-sort-destructure-keys": "^1.5.0",
3638
"eslint-plugin-sort-keys-fix": "^1.1.2",
3739
"eslint-plugin-typescript-sort-keys": "^2.1.0",
40+
"husky": "^8.0.3",
3841
"prettier": "^2.8.4"
3942
},
4043
"devDependencies": {

0 commit comments

Comments
 (0)