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.
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