npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@rajzik/conventional-commit-lint-config

v2.1.3

Published

Conventional commit lint config for personal projects

Readme

@rajzik/conventional-commit-lint-config

Commitlint configuration for the rajzik conventional changelog preset. Enforces conventional commit message format in your repository.

Installation

npm install --save-dev @commitlint/cli @rajzik/conventional-commit-lint-config
pnpm install --save-dev @commitlint/cli @rajzik/conventional-commit-lint-config
yarn add --dev @commitlint/cli @rajzik/conventional-commit-lint-config

Usage

Configuration

Create a commitlint.config.cjs (CommonJS) or commitlint.config.mjs (ESM) file:

CommonJS (commitlint.config.cjs):

module.exports = {
  extends: ['@rajzik/conventional-commit-lint-config'],
};

ESM (commitlint.config.mjs):

export default {
  extends: ['@rajzik/conventional-commit-lint-config'],
};

Integration with Git Hooks

Using Husky

npm install --save-dev husky
npx husky init

Add to .husky/commit-msg:

npx --no -- commitlint --edit $1

Using lint-staged

{
  "lint-staged": {
    "*.{ts,tsx,js,jsx}": ["commitlint --edit"]
  }
}

CLI Usage

# Check a commit message
echo "fix: Fix bug" | npx commitlint

# Check from stdin
npx commitlint --edit

# Check last commit
git log -1 --pretty=%B | npx commitlint

API Reference

Default Export

The default export is a commitlint configuration object:

{
  rules: {
    'body-max-length': [0],
    'scope-case': [0, 'never', 'start-case'],
    'subject-full-stop': [2, 'always', '.'],
    'subject-case': [2, 'always', 'sentence-case'],
    'type-enum': [2, 'always', CommitType[]],
  };
}

Rules

type-enum

Enforces that commit types match the conventional changelog types.

Severity: 2 (error)

Valid Types:

  • break, breaking - Breaking changes
  • build - Build system changes
  • ci, cd - CI/CD changes
  • deps - Dependency updates
  • docs - Documentation changes
  • feature - New features
  • fix - Bug fixes
  • internal - Internal changes
  • misc - Miscellaneous changes
  • new - New features
  • patch - Patch fixes
  • release - Release commits
  • revert - Revert commits
  • security - Security fixes
  • style, styles - Style changes
  • test, tests - Test changes
  • type, types - Type system changes
  • update - Feature updates

Example:

# ✅ Valid
fix: Fix button styling
new(Button): Add Button component
ci: Update GitHub Actions

# ❌ Invalid
invalid: Invalid commit type
feat: Use 'new' or 'feature' instead

subject-case

Enforces sentence-case for commit subjects.

Severity: 2 (error)

Format: sentence-case (first letter capitalized, rest lowercase)

Example:

# ✅ Valid
fix: Fix button styling
new(Button): Add Button component

# ❌ Invalid
fix: fix button styling
new(Button): add Button component

subject-full-stop

Enforces trailing period in commit subjects.

Severity: 2 (error)

Format: Always require trailing period

Example:

# ✅ Valid
fix: Fix button styling.
new(Button): Add Button component.

# ❌ Invalid
fix: Fix button styling
new(Button): Add Button component

scope-case

Allows flexible scope casing (disabled by default).

Severity: 0 (disabled)

Format: start-case (when enabled)

Example:

# All of these are valid:
fix(Button): Fix styling.
fix(button): Fix styling.
fix(BUTTON): Fix styling.

body-max-length

No limit on commit body length (disabled by default).

Severity: 0 (disabled)

Commit Message Format

This config enforces the following format:

<type>(<scope>): <subject>.

Where:

  • <type>: One of the valid commit types (see above)
  • <scope>: Optional scope in parentheses
  • <subject>: Sentence-case description ending with a period

Examples

Valid commits:

fix: Fix authentication bug.
new(Button): Add new Button component.
update(Modal): Refactor accessibility support.
ci: Add DangerJS to pipeline.
fix(auth): Fixed a bug with the authentication flow.

Invalid commits:

fix: fix bug                    # Wrong case, missing period
feat: Add feature              # Invalid type, missing period
new(Button): add button        # Wrong case, missing period
fix: Fix bug                   # Missing period

Customization

You can extend and override the configuration:

export default {
  extends: ['@rajzik/conventional-commit-lint-config'],
  rules: {
    'subject-full-stop': [2, 'always', '.'], // Keep default
    'subject-case': [2, 'always', 'lower-case'], // Override to lowercase
  },
};

Integration Examples

GitHub Actions

name: Lint Commits

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v3
      - run: npm install
      - run:
          npx commitlint --from ${{ github.event.pull_request.base.sha }} --to
          ${{ github.sha }} --verbose

Pre-commit Hook

#!/bin/sh
# .git/hooks/commit-msg

commit_msg=$(cat "$1")
npx commitlint --edit "$1" || exit 1

Related Packages

Further Reading