What is @commitlint/is-ignored?
The @commitlint/is-ignored npm package is designed to check if a given commit message should be ignored based on the rules defined in commitlint. This is particularly useful in automating the process of commit message validation, allowing developers to filter out commit messages that do not require validation according to the specified criteria.
What are @commitlint/is-ignored's main functionalities?
Check if a commit message is ignored
This feature allows you to check if a specific commit message should be ignored based on the commitlint configuration. It's useful for integrating with tools that automate commit message validation, enabling you to skip certain types of commits, such as those starting with 'chore:', 'docs:', or any other patterns you define in your commitlint configuration.
const isIgnored = require('@commitlint/is-ignored').default;
const commitMessage = 'chore: update dependencies';
const shouldIgnore = isIgnored(commitMessage);
console.log(shouldIgnore); // Output: true or false depending on the rules
Other packages similar to @commitlint/is-ignored
commitlint
commitlint is a broader package that includes the functionality of @commitlint/is-ignored as part of its suite for linting commit messages. It provides a CLI and configurable rules for validating commit messages, whereas @commitlint/is-ignored focuses solely on determining if a commit message should be ignored.
conventional-changelog
conventional-changelog is a set of tools for parsing and generating changelogs from git metadata, based on the conventions used in commit messages. While it focuses more on changelog generation from commit messages, it shares the concept of analyzing commit messages, similar to what @commitlint/is-ignored does for determining if a commit should be ignored.