diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..ddbac40 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged +# yarn workspace docs run test:lighthouse \ No newline at end of file diff --git a/package.json b/package.json index 0f473e5..b0eb509 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,13 @@ "dev": "turbo run dev", "lint": "turbo run lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"", + "prepare": "husky install", "web": "turbo run dev --scope=web", "docs": "turbo run dev --scope=docs" }, "devDependencies": { "eslint-config-custom": "*", + "husky": "^8.0.3", "prettier": "latest", "turbo": "^1.8.8" }, @@ -23,5 +25,16 @@ "node": ">=14.0.0" }, "dependencies": {}, - "packageManager": "yarn@1.22.19" -} \ No newline at end of file + "packageManager": "yarn@1.22.19", + "lint-staged": { + "apps/**/*.{js,ts,jsx,tsx}": [ + "eslint --fix" + ], + "packages/ui/**/*.{js,ts,jsx,tsx}": [ + "eslint --fix" + ], + "*.json": [ + "prettier --write" + ] + } +} diff --git a/yarn.lock b/yarn.lock index 8a9d663..215529d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8008,6 +8008,11 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +husky@^8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184" + integrity sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg== + i18next-fs-backend@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/i18next-fs-backend/-/i18next-fs-backend-2.1.1.tgz#07c6393be856c5a398e3dfc1257bf8439841cd89"