GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - vidavidorra/commitlint-plugin-function-rules: commitlint plugin to use functions as rule value

BranchesTags
Open more actions menu

Latest commit

 

History

1,267 Commits
1,267 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
commitlint.config.cjs
commitlint.config.cjs
 
 
eslint.config.js
eslint.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

commitlint plugin function rules

commitlint plugin to use functions as rule value.

  • Create custom function, sync or async, as rule value.
  • Create rules that are based on the commit message.
  • Write rules with regular expressions.
  • Use the same rules that are available in commitlint.

npm version npm downloads Node.js version support Renovate enabled semantic-release Code coverage License

  • Install
  • Usage
  • Contributing
  • Security policy
  • License

Install

npm install --save-dev commitlint-plugin-function-rules @commitlint/cli @commitlint/config-conventional

Usage

Use this plugin in your project's commitlint configuration by specifying it as item in the plugins array. All rules have same name as rules that are available in commitlint, but with the function-rules prefix. The example commitlint.config.js, or commitlint.config.cjs if the package is an ES module, shows the usage of a function rule.

Note The available rules are the same as in commitlint, so it is recommended to disable the commitlint rule when specifying a function rule to avoid undefined behaviour.

module.exports = {
  extends: ['@commitlint/config-conventional'],
  plugins: ['commitlint-plugin-function-rules'],
  rules: {
    'header-max-length': [0], // level: disabled
    'function-rules/header-max-length': [
      2, // level: error
      'always',
      (parsed) => {
        // Allow longer headers for commits with "deps" scope.
        if (parsed.scope === 'deps' && parsed.header.length <= 200) {
          return [true];
        }
        return [false, 'deps header must not be longer than 200 characters'];
      },
    ],
  },
};

Contributing

Please create an issue if you have a bug report or feature proposal, or create a discussion if you have a question. If you like this project, please consider giving it a star ⭐

Refer to the contributing guide for detailed information about other contributions, like pull requests.

Conventional Commits: 1.0.0 Linter XO code style Code style

Security policy

Please refer to the Security Policy on GitHub for the security policy.

License

This project is licensed under the GPLv3 license.

Copyright © 2020-2026 Jeroen de Bruijn

License notice

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

The full text of the license is available in the LICENSE file in this repository and online.

About

commitlint plugin to use functions as rule value

Topics

commitlintcommitlintpluginfunctionpluginrules

Resources

Readme
GPL-3.0 license

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

52 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Sponsor this project

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.