How to use @commitlint/parse - 1 common examples

To help you get started, we’ve selected a few @commitlint/parse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github conventional-changelog / commitlint / @commitlint / lint / src / index.js View on Github external
export default async (message, rules = {}, opts = {}) => {
	// Found a wildcard match, skip
	if (
		isIgnored(message, {defaults: opts.defaultIgnores, ignores: opts.ignores})
	) {
		return {
			valid: true,
			errors: [],
			warnings: [],
			input: message
		};
	}

	// Parse the commit message
	const parsed = await parse(message, undefined, opts.parserOpts);

	const mergedImplementations = Object.assign({}, implementations);
	if (opts.plugins) {
		values(opts.plugins).forEach(plugin => {
			if (plugin.rules) {
				Object.keys(plugin.rules).forEach(ruleKey => {
					mergedImplementations[ruleKey] = plugin.rules[ruleKey];
				});
			}
		});
	}

	// Find invalid rules configs
	const missing = Object.keys(rules).filter(
		name => typeof mergedImplementations[name] !== 'function'
	);

@commitlint/parse

Lint your commit messages

MIT
Latest version published 2 months ago

Package Health Score

100 / 100
Full package analysis

Popular @commitlint/parse functions