* Update Husky to v9

* Update lint-staged

* Backward compatibility with Husky 8
This commit is contained in:
David
2024-01-31 20:32:00 +01:00
committed by GitHub
parent e384a24202
commit e4f85f5f7c
5 changed files with 31 additions and 16 deletions

11
.husky/install.mjs Normal file
View File

@@ -0,0 +1,11 @@
// See: https://typicode.github.io/husky/how-to.html#ci-server-and-docker
// Do not initialize Husky in CI environments. GitHub Actions set the CI env variable automatically.
// See: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
if (process.env.CI === 'true') {
process.exit(0);
}
// Initialize Husky programmatically.
const husky = (await import('husky')).default;
console.log(husky());

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# TODO: Remove first 2 lines: https://github.com/AdguardTeam/AdguardFilters/pull/171886#issuecomment-1918731193
# See https://git-scm.com/docs/githooks#_post_merge
# This function checks if a file has changed between the current HEAD and the previous HEAD

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# TODO: Remove first 2 lines: https://github.com/AdguardTeam/AdguardFilters/pull/171886#issuecomment-1918731193
# See https://git-scm.com/docs/githooks#_pre_commit
npx lint-staged