diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..7cd8dd9 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install commitlint --edit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..42261a6 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npm run prettier +npm run lint diff --git a/package.json b/package.json index f505077..4eb0298 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "eslint-plugin-react-hooks": "4.3.0", "eslint-plugin-react-native": "3.11.0", "eslint-plugin-unused-imports": "^2.0.0", - "husky": "^7.0.4", + "husky": "^7.0.0", "metro-react-native-babel-preset": "^0.66.2", "prettier": "^2.5.1", "typescript": "^4.5.4" @@ -57,9 +57,9 @@ "android": "npx react-native run-android", "ios": "npx react-native run-ios", "start": "react-native start --reset-cache", - "husky:setup": "npx husky-init && npm run husky:commitlint && npm run husky:prettier", + "husky:setup": "npx husky-init && npm run husky:commitlint && npm run husky:prettier && npm run husky:lint", "husky:commitlint": "npx husky add .husky/commit-msg 'npx --no-install commitlint --edit'", - "husky:prettier": "npx husky add .husky/pre-commit 'npm run prettier'", + "husky:prettier": "npx husky set .husky/pre-commit 'npm run prettier'", "husky:lint": "npx husky add .husky/pre-commit 'npm run lint'", "clean-up": "rm -rf .git && rm -rf ./assets && git init && npm run husky:setup", "clean:android": "cd android && ./gradlew clean",