Registry / testing / git-commit-msg-linter

git-commit-msg-linter

JSON →
library5.0.8jsnpmunverified

A lightweight, independent, zero-configuration git commit message linter that enforces the Angular Commit Message Guidelines. Version 5.0.8 requires Node >= 14.0.0. It operates as a git 'commit-msg' hook, instantly checking every commit message and aborting if invalid. Unlike commitlint or other tools, it requires no setup, configuration files, or additional dependencies. Ships with TypeScript type definitions. Release cadence: irregular, with occasional updates.

npm install git-commit-msg-linter
INSTALL
IMPORT
SIG · GIT-COMMIT-MSG-LIN
G
git-commit-msg-linter
testingjavascriptv5.0.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

git-commit-msg-linter
✓ import 'git-commit-msg-linter'
This package is a hook; simply importing it in your Node.js project registers the git hook. TypeScript types are included.

Install the package as dev dependency; it automatically sets up a git commit-msg hook that lints future commit messages per Angular conventions.

// In your project root, run: npm install git-commit-msg-linter --save-dev // Then commit: git commit -m "feat: add new feature" // To test linting, try: git commit -m "bad commit" // It will abort with a message listing valid types.
Debug
Known issues
gotchaThe hook is installed only if the .git directory exists. In CI environments without .git, installation may silently fail.
fix
Ensure .git is present before install, or use a conditional install script.
affects: *
deprecatedNode.js < 14.0.0 is no longer supported after version 5.0.0.
fix
Upgrade Node.js to >=14.0.0 or pin to version 4.x.
affects: >=5.0.0 <5.0.8
gotchaThe hook uses 'commitlintrc.json' if present for customization, but the file name is easily misspelled as 'commitlintrc.json' (note the missing 'e' in 'linter').
fix
Use correct filename: 'commitlinterrc.json' (no 'e' after 'lint').
affects: *
gotchaWhen using with husky v5+, the hook may not trigger because husky manages its own hooks. The order of installation matters.
fix
Install husky after git-commit-msg-linter, or configure husky to run the linter script.
affects: *
deprecatedThe package uses the 'gcm' hook; if you previously used another commit-msg hook, it may be overwritten.
fix
Backup existing hooks before installing.
affects: *
gotchaIn some environments (e.g., Windows with git bash), the hook may fail due to path issues. The error message is often unhelpful.
fix
Ensure Node.js is in PATH and the shebang line in the hook file is correct (usually '#!/usr/bin/env node').
affects: *
breakingVersion 5.0.0 changed the default enforcements: 'temp' type removed, 'style' now allows scope.
fix
Update commit messages to use valid types; adjust custom config if needed.
affects: 5.0.0
Errors
Common errors & fixes
git-commit-msg-linter: commit message is invalid
Commit message does not follow the Angular format: missing type or colon.
fix
Use format like 'feat: add login button' or 'fix(scope): resolve crash'.
fatal: cannot run .git/hooks/commit-msg: No such file or directory
The hook file is missing due to failed installation or .git directory not present.
fix
Reinstall npm package or manually remove and re-add the hook via npm rebuild.
Error: EACCES: permission denied, open '.git/hooks/commit-msg'
The npm install script lacks write permission to the .git/hooks directory.
fix
Run npm install with appropriate permissions (e.g., sudo on Unix).
.commitlinterrc.json: no such file or directory
Custom config file referenced but not found, or misspelled filename.
fix
Create 'commitlinterrc.json' in project root with correct spelling (no 'e' after 'lint').
npm WARN deprecated git-commit-msg-linter@5.0.8: This package is no longer maintained
The use of an outdated version that has been deprecated.
fix
Migrate to an alternative like @commitlint/cli or update to latest version if not deprecated.
Upgrade
Version history
5.0.8latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources