From 9a9580e7f40e6fbfc9c398e30211c9e8f8fa39cd Mon Sep 17 00:00:00 2001 From: Nihal Gonsalves Date: Thu, 3 Aug 2023 20:27:43 +0200 Subject: [PATCH] chore: add lefthook --- lefthook.yml | 16 ++++++++++++++++ package.json | 1 + yarn.lock | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 lefthook.yml diff --git a/lefthook.yml b/lefthook.yml new file mode 100644 index 0000000..5ee3da6 --- /dev/null +++ b/lefthook.yml @@ -0,0 +1,16 @@ +# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md + +pre-commit: + parallel: true + commands: + prettier: + glob: '*.{js,ts,jsx,tsx,mjs,mts,cjs,cts,json,yml,yaml,md}' + run: yarn prettier --write {staged_files} + stage_fixed: true + eslint: + glob: '*.{js,ts,jsx,tsx,mjs,mts,cjs,cts}' + run: yarn eslint --fix {staged_files} + stage_fixed: true + typescript-build: + glob: '*.{js,ts,jsx,tsx,mjs,mts,cjs,cts}' + run: yarn typecheck diff --git a/package.json b/package.json index 9923c78..146f92e 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "eslint": "^8.46.0", "eslint-define-config": "^1.22.0", "husky": "^8.0.3", + "lefthook": "^1.4.8", "prettier": "^3.0.0", "typescript": "^5.1.6" }, diff --git a/yarn.lock b/yarn.lock index 769427a..f572441 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1923,6 +1923,60 @@ language-tags@=1.0.5: dependencies: language-subtag-registry "~0.3.2" +lefthook-darwin-arm64@1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook-darwin-arm64/-/lefthook-darwin-arm64-1.4.8.tgz#4d1a425b5aad9cf598dcf3ed5a65078dc90d56c6" + integrity sha512-wUaasRq7P1BNAlGwu/vONVHrwlrTwQGEhyn0leciEcnQCUN8aTeEC4hkxHmxisgQVQTdidYkCSWcsaEFn84xzw== + +lefthook-darwin-x64@1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook-darwin-x64/-/lefthook-darwin-x64-1.4.8.tgz#a5f25db8411b8d9f0e5a26a1f49e150dfdd780e4" + integrity sha512-uUkQeU08szL4IpKVQSlhzNObZ79YkwmZ3fZDmF+jjP69LMESEVY7Y+cuQI0RG4YOTXHGBqZs3MPUZ7ZygBrhcQ== + +lefthook-freebsd-arm64@1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook-freebsd-arm64/-/lefthook-freebsd-arm64-1.4.8.tgz#c31b4d7f74ce29eeb27a9bde238d52d5526dd554" + integrity sha512-X4rWxsmxfyMRgfIOqAnk2zrMzlJV0fANEDYNuUYBVbgH8IYAy1cyVQlolgeC8NhFW8VaJ3AztbWpnR1M8zEByA== + +lefthook-freebsd-x64@1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook-freebsd-x64/-/lefthook-freebsd-x64-1.4.8.tgz#1d1382f35e0da9d5d5efc90bbc2581e1425c5924" + integrity sha512-ijenlZtEZpbnLFWTZdsIDmVdLzkaTkeEQVjjHEXdo2GBjLmdLYk8hRQiY/7oUxFe/JO1RLuhfIlPkKLtYz1iTQ== + +lefthook-linux-arm64@1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook-linux-arm64/-/lefthook-linux-arm64-1.4.8.tgz#21aa8db2591ea772869885f5e9fc6b0e4ffefd32" + integrity sha512-lOsJymblZ8nIpgm2lLfWx33tXtkdamK0lZThbSK4uwZQWFzSjr9qx21qZlJZ/mG8jZ5EY5Twhjqrt131CUXtMw== + +lefthook-linux-x64@1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook-linux-x64/-/lefthook-linux-x64-1.4.8.tgz#dcedf19c6633867e43aec7455a3a3e04312e1f59" + integrity sha512-tF/iQFZu9iR++C3UXvpeTQS50CtTdZWmeMJ49uAovu9qe3qpPdKoguorZSFDC2+OGYbd7wbulldpWhvgxarniA== + +lefthook-windows-arm64@1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook-windows-arm64/-/lefthook-windows-arm64-1.4.8.tgz#9c259243943197bf7479538e934e9e692476285b" + integrity sha512-ykqX5rm5UI6244cF6anf92p+JXNvuA/Ah3bpQKYSA5JoMG2vJmPZ9nIThq5ky/F90jXySBxcdZRdrridtagAbw== + +lefthook-windows-x64@1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook-windows-x64/-/lefthook-windows-x64-1.4.8.tgz#9226edf148e66fbf583f4438cdeea5d810fee3c4" + integrity sha512-wv8in0vku5eDpjNtri4s02kXbowEa6t/h8pHHUnCedmJJ2ImwwqGQJ1kwDVQL0U3bgdNWCfC2mUxVmtXoLQkBg== + +lefthook@^1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/lefthook/-/lefthook-1.4.8.tgz#8028217992d58657ec6eb96235d04ecd61fcabd3" + integrity sha512-SALO6nIy0aizM3FJdy4cNdUy9qKJyGZo6f8gZdzhBuKLMrwnm9YeMdJmQKeEPZA9E2mDSqdHGJjvMlKrm+04Pg== + optionalDependencies: + lefthook-darwin-arm64 "1.4.8" + lefthook-darwin-x64 "1.4.8" + lefthook-freebsd-arm64 "1.4.8" + lefthook-freebsd-x64 "1.4.8" + lefthook-linux-arm64 "1.4.8" + lefthook-linux-x64 "1.4.8" + lefthook-windows-arm64 "1.4.8" + lefthook-windows-x64 "1.4.8" + levn@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"