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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@amollo-lint/commitlint-plugin-card-id

v1.3.0

Published

recognition and inclusion of the card ID

Downloads

14

Readme

@amollo-lint/commitlint-plugin-card-id

MIT License npm version

recognition and inclusion of the card ID

Installation

  • npm
npm install --save-dev @amollo-lint/commitlint-plugin-card-id @commitlint/config-conventional @commitlint/cli
  • yarn
yarn add -D @amollo-lint/commitlint-plugin-card-id @commitlint/config-conventional @commitlint/cli

Usage

Set your commitlint config to:

{
    extends: "@commitlint/config-conventional",
    plugins: ["@amollo-lint/commitlint-plugin-card-id"],
    rules: {
        "card-id": [
            2,
            "always",
            {
                required: true,
                position: "start",
                spaceBeforeAfter: "both",
                prefixId: "c-",
                borderType: "|",
                minLengthId: 3,
                ignoreTypes: ["build", "test", "ci"],
                log: {
                    message: "Link to the map in trello https://trello.com/c/<trello_id>",
                    onlyId: true,
                    pattern: "<trello_id>"
                }
            }
        ]
    }
}

Example

$ git commit -m "feat(bar): |c-ES7Mn9Ow| update animation for bar"

Link to the card in trello https://trello.com/c/ES7Mn9Ow

Options

position

Location in the subject of the commit accept - "start" and "end" default - "start" example:

  • start
    • incorrect
      • "<type>(<scope>): initial commit |c-ES7Mn9Ow|"
      • "<type>(<scope>): initial |c-ES7Mn9Ow| commit"
    • correct
      • "<type>(<scope>): |c-ES7Mn9Ow| initial commit"
  • end
    • incorrect
      • "<type>(<scope>): initial |c-ES7Mn9Ow| commit"
      • "<type>(<scope>): |c-ES7Mn9Ow| initial commit"
    • correct
      • "<type>(<scope>): initial commit |c-ES7Mn9Ow|"

ignoreTypes

Ignoring the card-id rule for comparable types accept - string[] | string default - [] example:

  • ["test", "ci"] - required: true
    • incorrect -
      • "fix(<scope>): initial commit"
    • correct
      • "ci(<scope>): initial commit"

ignoreScopes

Ignoring the card-id rule for comparable scopes accept - string[] | string default - [] example:

  • ["root", "sidebar"] - required: true
    • incorrect -
      • "<type>(otherScope): initial commit"
    • correct
      • "<type>(sidebar): initial commit"

prefixId

Prefix for identifier accept - string default - "c-" example:

  • id-
    • incorrect
      • "<type>(<scope>): |ES7Mn9Ow| initial commit"
      • "<type>(<scope>): |id:ES7Mn9Ow| initial commit"
    • correct
      • "<type>(<scope>): |id-ES7Mn9Ow| initial commit"

borderType

Card id border type accept - string | [string, string] acceptSingleValue - "| or ||" | "{ or {}" | "< or <>" | "( or ()" default - "|" example:

  • { or ["{", "}"]
    • incorrect
      • "<type>(<scope>): [c-ES7Mn9Ow] initial commit"
      • "<type>(<scope>): (c-ES7Mn9Ow) initial commit"
    • correct
      • "<type>(<scope>): {c-ES7Mn9Ow} initial commit"

minLengthId

Minimum identifier length accept - number default - 2 example:

  • 4
    • incorrect
      • "<type>(<scope>): |c-ES7| initial commit"
    • correct
      • "<type>(<scope>): |c-ES7M| initial commit"

required

If true, then the map id must be in the commit subject. If false, validation will only occur when the map id pattern is found in the commit subject accept - false or true default - true example:

  • false - minLengthId: 4
    • incorrect
      • "<type>(<scope>): |c-ES7| initial commit"
    • correct
      • "<type>(<scope>): initial commit"
      • "<type>(<scope>): |c-ES7Mn9Ow| initial commit"
  • true
    • incorrect
      • "<type>(<scope>): initial commit"
    • correct
      • "<type>(<scope>): |c-ES7Mn9Ow| initial commit"

idMatch

Matching with your own pattern accept - RegExp default - null example:

  • /^\d+$/ - only numbers
    • incorrect
      • "<type>(<scope>): |c-ES7Mn9Ow| initial commit"
    • correct
      • "<type>(<scope>): |c-4129791| initial commit"

spaceBeforeAfter

Space on the sides of the card ID accept - "before" | "after" | "both" default - if position is equal to start, then "both" otherwise position is equal to end, then "before" example:

  • after - position: end
    • incorrect
      • "<type>(<scope>): initial commit |c-ES7Mn9Ow|"
    • correct
      • "<type>(<scope>): initial commit |c-ES7Mn9Ow| "

headerLikeSubject

If checking a commit without headers, enable this option so that the commit subject is accepted as the header accept - true or false default - false example:

  • true
    • incorrect
      • "<type>(<scope>): |c-ES7Mn9Ow| initial commit"
    • correct
      • "|c-ES7Mn9Ow| initial commit"

log

Displaying a message after a successful commit check accept - {message: string, onlyId: boolean, pattern: string} | string default - null