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>
zio/stable
Joel 2024-06-16 12:42:15 +02:00 committed by GitHub
parent d0bb97e8a9
commit 10c6035f31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env sh #!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh" . "$(dirname -- "$0")/_/husky.sh"
yarn lint-staged npx lint-staged