diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..d24fdfc --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/package.json b/package.json index 86a1b33..ab995d8 100644 --- a/package.json +++ b/package.json @@ -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": {