about summary refs log tree commit diff
path: root/.husky
diff options
context:
space:
mode:
authorJoel <joel.garplind@gmail.com>2024-06-16 12:42:15 +0200
committerGitHub <noreply@github.com>2024-06-16 13:42:15 +0300
commit10c6035f310ba1a3a0420a4e013e2b2b30ddb374 (patch)
tree3ee6ee67eba911cfe1577de85b07551f9455e969 /.husky
parentd0bb97e8a9e9ae5e36c85dcb292616e60558a921 (diff)
downloadvoidsky-10c6035f310ba1a3a0420a4e013e2b2b30ddb374.tar.zst
Make `lint-staged` work in more envs (#4532)
When setting up the environment on a Windows machine with Git Bash, the pre-commit hook errored out:

> /usr/bin/bash: line 1: C:UsersNameFoldersocial-appnode_modules.binlint-staged: command not found

Seemingly, `yarn lint-staged` is not able to correctly resolve the path.

This commit changes the pre-commit hook to use `npx` instead of `yarn`, for 2 reasons:
1. It works on my machine (and is supposedly a more universal solution)
2. It is how it is done in the documentation: https://github.com/lint-staged/lint-staged?tab=readme-ov-file#examples

Co-authored-by: Joel <joel.garplind+github@gmail.com>
Diffstat (limited to '.husky')
-rwxr-xr-x.husky/pre-commit2
1 files changed, 1 insertions, 1 deletions
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 5a182ef10..d24fdfc60 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1,4 @@
 #!/usr/bin/env sh
 . "$(dirname -- "$0")/_/husky.sh"
 
-yarn lint-staged
+npx lint-staged