Socket
Socket
Sign inDemoInstall

@commitlint/load

Package Overview
Dependencies
14
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/load


Version published
Maintainers
4
Install size
46.6 MB
Created

Package description

What is @commitlint/load?

The @commitlint/load package is part of the commitlint toolchain, which is used to enforce consistent commit message formats according to various configurable rules. This package specifically handles the loading of commitlint configuration from various sources, allowing users to define rules that commit messages should adhere to in their projects.

What are @commitlint/load's main functionalities?

Load Configuration

This feature allows the loading of commitlint configuration files. It supports loading from a specified path or from node_modules. The example shows how to load a common configuration that extends '@commitlint/config-conventional'.

const { load } = require('@commitlint/load');

async function loadConfig() {
  const config = await load({extends: ['@commitlint/config-conventional']});
  console.log(config);
}

loadConfig();

Merge Configurations

This feature demonstrates how to merge custom rules with existing configurations. The example merges a custom rule that restricts commit types to 'feat', 'fix', and 'docs' into the project's commitlint configuration.

const { load } = require('@commitlint/load');

async function mergeConfigs() {
  const config = await load({
    rules: {
      'type-enum': [2, 'always', ['feat', 'fix', 'docs']]
    }
  }, {cwd: '/path/to/project'});
  console.log(config);
}

mergeConfigs();

Other packages similar to @commitlint/load

Changelog

Source

17.7.1 (2023-08-10)

Reverts

  • Revert "feat(load): use cosmiconfig-typescript-loader v5 to remove ts-node dependency for @commitlint/load (#3633)" (8e41897), closes #3633

Readme

Source

Load shared commitlint configuration

@commitlint/load

Getting started

npm install --save-dev @commitlint/load

Example

const load = require('@commitlint/load').default;

load({extends: ['./package']}).then((config) => console.log(config));
// => { extends: ['./package', './package-b'], rules: {} }

Consult docs/api for comprehensive documentation.

Keywords

FAQs

Last updated on 10 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc