How to use the @commitlint/ensure.case 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 / scope-case.js View on Github external
			segment => delimiters.test(segment) || ensure.case(segment, check.case)
		);
github conventional-changelog / commitlint / @commitlint / rules / src / header-case.ts View on Github external
const result = checks.some(check => {
		const r = ensure.case(header, check.case);
		return negated(check.when) ? !r : r;
	});
github conventional-changelog / commitlint / @commitlint / rules / src / subject-case.js View on Github external
const result = checks.some(check => {
		const r = ensure.case(subject, check.case);
		return negated(check.when) ? !r : r;
	});
github conventional-changelog / commitlint / @commitlint / rules / src / type-case.js View on Github external
const result = checks.some(check => {
		const r = ensure.case(type, check.case);
		return negated(check.when) ? !r : r;
	});
github conventional-changelog / commitlint / @commitlint / rules / src / body-case.js View on Github external
export default (parsed, when, value) => {
	const {body} = parsed;

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

	const negated = when === 'never';

	const result = ensure.case(body, value);
	return [
		negated ? !result : result,
		message([`body must`, negated ? `not` : null, `be ${value}`])
	];
};