configure husky and lint-staged

This commit is contained in:
jinhojang6 2023-04-19 21:15:21 +09:00
parent 8e88fd14e1
commit 3b91ef6474
2 changed files with 9 additions and 6 deletions

4
.husky/pre-commit Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged

View File

@ -6,14 +6,13 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"prepare": "husky install"
},
"lint-staged": {
"src/**/*.{ts,tsx}": [
"eslint --ext .tsx,ts src/ --fix"
],
"src/**": [
"prettier --check 'src/**/*.ts' 'src/**/*.tsx'"
"*.{ts,tsx}": [
"prettier --write",
"eslint --fix"
]
},
"husky": {