Skip to content

fix: added husky check and lock-file update#35

Merged
harshithad0703 merged 3 commits intodevelopmentfrom
fix/snyk
Mar 6, 2026
Merged

fix: added husky check and lock-file update#35
harshithad0703 merged 3 commits intodevelopmentfrom
fix/snyk

Conversation

@cs-raj
Copy link
Copy Markdown
Contributor

@cs-raj cs-raj commented Mar 6, 2026

PR Description

Summary

Improves repo setup for contributors and CI: fixes Husky 9 pre-commit hook wiring, adds automatic hook installation on clone/install, upgrades jsdom with a matching Node engine, and keeps the repo clean by ignoring Husky’s internal directory.


Changes

Husky 9 & pre-commit hook

  • Hook file name: Renamed .husky/.pre-commit.husky/pre-commit so Husky 9 correctly discovers and runs the hook (Husky 9 expects hook names without a leading dot).
  • Auto-install on clone: Added a prepare script that runs npx husky and chmod +x .husky/pre-commit, so after git clone + npm install, Git hooks are set up and the pre-commit hook runs on commit.
  • Ignore Husky internal folder: Added .husky/_ to .gitignore. Husky 9 creates this directory when husky runs; it is not meant to be committed and will no longer show up in git status.

The pre-commit hook continues to run Talisman (secret scan) and Snyk (vulnerability scan); both must pass before a commit is allowed. Use SKIP_HOOK=1 to bypass when needed.

jsdom upgrade (v20 → v23)

  • Dependency: Bumped jsdom from ^20.x to ^23.0.0.
  • Compatibility: Existing usage (new JSDOM(html), dom.window.document.querySelector('body'), and passing the body node to collapse-whitespace and htmlToJson) relies only on stable DOM APIs and is compatible with jsdom 23.
  • Node engine: Updated engines.node from >=14.0.0 to >=18.0.0 to align with jsdom 23’s requirement (Node 18+).

Testing

  • npm install in a fresh clone runs prepare and sets up .husky/_ and executable .husky/pre-commit.
  • git commit triggers the pre-commit hook (Talisman + Snyk) when Talisman and Snyk are installed.
  • Existing tests pass with jsdom 23 and Node 18+.
  • No .husky/_ or other Husky internals are committed; only .husky/pre-commit is tracked.

Notes for reviewers

  • Contributors need Talisman and Snyk installed locally for the pre-commit hook to succeed; the hook prints clear errors if either is missing.
  • Node 14/16 are no longer supported due to the jsdom 23 + engines.node bump; consider documenting this in the README if not already.

@cs-raj cs-raj requested a review from a team as a code owner March 6, 2026 13:36
@harshithad0703 harshithad0703 merged commit 627746d into development Mar 6, 2026
7 checks passed
@harshithad0703 harshithad0703 deleted the fix/snyk branch March 6, 2026 13:42
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.

2 participants