ci: fix pre-commit hook for non-TS commits; ignore @types/node majors - #75
Merged
Conversation
Two CI-hygiene fixes: - .husky/pre-commit: husky 9 runs hooks under `sh -e`, so the STAGED_FILES `grep` aborted the hook (exit 1) whenever a commit touched no .ts/.js/.json/.md files - blocking .yml/.sh-only commits. Guard with `|| true`. - .github/dependabot.yml: ignore `@types/node` semver-major bumps. It should track the lowest supported Node major (engines >=20); majors type-check APIs unavailable on Node 20. Recurred as PRs #67 and #74, both closed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small CI-hygiene fixes.
1. pre-commit hook bug (found while committing this PR)
husky 9 runs hooks under
sh -e(.husky/_/h:sh -e "$s"). The hook'sSTAGED_FILES=$(… | grep -E '…')line exits 1 when a commit touches no.ts/.js/.json/.mdfiles, and underset -ethat aborts the whole hook — so any commit of only.yml,.sh, etc. was blocked. This regressed silently in the husky 8→9 migration (#36); v8 didn't run hooks with-e. Fixed with|| trueso a no-match grep yields an empty list and the existing "no staged files" path runs.2. Dependabot: ignore @types/node majors
@types/nodeshould track the lowest supported Node major (engines >=20). A major bump type-checks APIs that don't exist on Node 20, giving false compatibility confidence. This recurred as PR #67 and PR #74 (both closed); the ignore rule stops the churn. Bump@types/nodedeliberately when the engines floor moves.Closes #74 (by making it moot).
🤖 Generated with Claude Code