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

commitlint-config-czx

v0.0.1

Published

commitlint sharable configuration files

Downloads

39

Readme

commitlint-config-cz

npm Build Status Build status Coverage Status

commitlint sharable configuration files, which also includes modules & API for config conversion.

If .cz-config.js that is for @whizark/cz-cli or cz-customizable exists in your package root directory, its {types,scopes,scopeOverrides} are merged with rules.{type-enum,scope-enum}.

Installation

Install commitlint-config-cz as a local dependency.

npm install commitlint-config-cz --save-dev

Usage

Extend commitlint-config-cz in commitlint.config.js.

module.exports = {
    extends: [
        'other-config',
        'cz'
    ]
};

Modules & API

There are some modules and API to convert cz-customizable's config into commitlint's config.

config.js

Gets the commitlint config from the .cz-config.js in the package root.

const config = require('commitlint-config-cz/lib/config')();

get(pathOrCzConfig: string | Object, defaultConfig?: Object): Object

Gets the commitlint config from a cz-customizable config.

const getConfig = require('commitlint-config-cz/lib/config').get;

// From a path.
const config = getConfig('path/to/.cz-config.js');
const getConfig = require('commitlint-config-cz/lib/config').get;
const czConfig  = { /* `cz-customizable` config object. */ };

// From a `cz-customizable` config object.
const config = getConfig(czConfig);
const getConfig     = require('commitlint-config-cz/lib/config').get;
const czConfig      = { /* `cz-customizable` config object. */ };
const defaultConfig = {  // The default `commitlint` config.
    rules: {
        'scope-enum': [  // rule
            2,           // [1] level
            'always',    // [2] applicability
            [],          // [3] value
        ],
        'type-enum' : [  // rule
            2,           // [1] level
            'always',    // [2] applicability
            [],          // [3] value
        ],
    },
};

// Converts and merges the `cz-customizable` config with the default `commitlint` config.
const config = getConfig(czConfig, defaultConfig);
  1. If cz-customizable config has scopes, scopeOverrides or types field, the value(s) [3] of the default commitlint config is/are REPLACED by converted value(s).
    Level [1] and applicability [2] remain as they are.
  2. scope-enum rule or/and type-enum rule is/are completely REMOVED, if its value is an empty array.

cz-config.js

Gets the .cz-config.js as an object in the package root.

const czConfig = require('commitlint-config-cz/lib/cz-config')();

get(path: string): Object

Gets the cz-customizable config object from a path.

const getCzConfig = require('commitlint-config-cz/lib/cz-config').get;

const czConfig = getCzConfig('path/to/.cz-config.js');

scopes.js

Gets the value for scope-enum rule from the .cz-config.js in the package root.

const scopes = require('commitlint-config-cz/lib/scopes')();

get(czConfig: Object): string[]

Gets the value for scope-enum rule from a cz-customizable config object.

const getScopes = require('commitlint-config-cz/lib/scopes').get;
const czConfig  = { /* `cz-customizable` config object. */ };

const scopes = getScopes(czConfig);

types.js

Gets the value for type-enum rule from the .cz-config.js in the package root.

const types = require('commitlint-config-cz/lib/types')();

get(czConfig: Object): string[]

Gets the value for type-enum rule from a cz-customizable config object.

const getTypes = require('commitlint-config-cz/lib/types').get;
const czConfig = { /* `cz-customizable` config object. */ };

const types = getTypes(czConfig);