Skip to content

chore: husky setup modernization#620

Open
KristjanESPERANTO wants to merge 5 commits into
commenthol:masterfrom
KristjanESPERANTO:husky
Open

chore: husky setup modernization#620
KristjanESPERANTO wants to merge 5 commits into
commenthol:masterfrom
KristjanESPERANTO:husky

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Contributor

Noticed a deprecation warning when committing, so I had a look at the setup and cleaned a few things up.

  • Updated prepare script to use the modern husky command
  • Consolidated commitlint config in one place (was split between package.json and .commitlint.config.cjs)
  • Simplified the commit-msg hook (removed unnecessary npx --no-install)
  • Activated pre-commit hook to run lint before commits

Only the last change actually affects the workflow (lint check). The rest is just getting ahead of v10 deprecations.


The mentioned warning

$ git commit --amend --no-edit
husky - DEPRECATED

Please remove the following two lines from .husky/pre-commit:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

They WILL FAIL in v10.0.0

Remove the legacy Husky prologue lines from pre-commit and commit-msg.
Those lines are deprecated and would fail in Husky v10.
Replace `husky install` in the prepare script with `husky` to
match current Husky recommendations and avoid deprecation churn in
future upgrades.
Keep commitlint configuration in a single place to prevent drift

between package.json and commitlint.config.cjs. This makes hook

behavior predictable and easier to maintain.
Use the commitlint binary from PATH instead of npx --no-install.
Husky already prepends node_modules/.bin, so this reduces startup
overhead and keeps the hook simpler.
Add an active pre-commit check instead of leaving a no-op hook.
Running lint before commit catches style and quality issues early
and keeps the branch history cleaner.
@KristjanESPERANTO KristjanESPERANTO changed the title chore: husky setup modernisierung chore: husky setup modernization May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant