Registry / devops / wangtron-lint-commit

wangtron-lint-commit

JSON →
library1.1.3jsnpmunverified

A simple commit message linter that enforces conventional commit format. v1.1.3 is the latest stable release. It checks commit messages against a configurable pattern, with custom error messages. Minimal dependencies, zero-config setup. Uses local git hooks via husky or lint-staged.

npm install wangtron-lint-commit
INSTALL
IMPORT
SIG · WANGTRON-LINT-COMM
W
wangtron-lint-commit
devopsjavascriptv1.1.3
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.

lintCommit
import { lintCommit } from 'wangtron-lint-commit'
const lintCommit = require('wangtron-lint-commit')
Package is ESM-only since v1.1.0.

Shows how to use lintCommit in a Husky commit-msg hook to validate commit messages.

// .husky/commit-msg import { lintCommit } from 'wangtron-lint-commit'; import { readFileSync } from 'fs'; const message = readFileSync(process.argv[2], 'utf8'); const { valid, error } = lintCommit(message); if (!valid) { console.error(error); process.exit(1); }
wangtron-lint-commit --version
Debug
Known issues
gotchaDefault config only enforces 'type(scope): description' format. Custom regex required for advanced rules.
fix
Provide custom regex option.
affects: <=1.1.3
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
Husky script not using ES modules
fix
Set "type": "module" in package.json or use .mjs extension.
Upgrade
Version history
1.1.3latest on npm
Audit
Dependencies
huskyoptionalGit hooks setup for commit linting
Agent activity
12 hits · last 30 days
node
10
Resources
wangtron-lint-commit — npm install wangtron-lint-commit · libregistry