How to use the @commitlint/ensure.maxLineLength function in @commitlint/ensure

To help you get started, we’ve selected a few @commitlint/ensure 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 / rules / src / footer-max-line-length.ts View on Github external
const footerMaxLineLength: Rule = (
	parsed,
	when = 'always',
	value = 0
) => {
	const input = parsed.footer;

	if (!input) {
		return [true];
	}

	return [
		maxLineLength(input, value),
		`footer's lines must not be longer than ${value} characters`
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / body-max-line-length.ts View on Github external
const bodyMaxLineLength: Rule = (parsed, when, value) => {
	const input = parsed.body;

	if (!input || value === undefined) {
		return [true];
	}

	return [
		maxLineLength(input, value),
		`body's lines must not be longer than ${value} characters`
	];
};