How to use the @commitlint/ensure.notEmpty 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-empty.js View on Github external
export default (parsed, when) => {
	const negated = when === 'never';
	const notEmpty = ensure.notEmpty(parsed.footer);

	return [
		negated ? notEmpty : !notEmpty,
		message(['footer', negated ? 'may not' : 'must', 'be empty'])
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / body-empty.js View on Github external
export default (parsed, when) => {
	const negated = when === 'never';
	const notEmpty = ensure.notEmpty(parsed.body);

	return [
		negated ? notEmpty : !notEmpty,
		message(['body', negated ? 'may not' : 'must', 'be empty'])
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / type-empty.js View on Github external
export default (parsed, when) => {
	const negated = when === 'never';
	const notEmpty = ensure.notEmpty(parsed.type);
	return [
		negated ? notEmpty : !notEmpty,
		message(['type', negated ? 'may not' : 'must', 'be empty'])
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / scope-empty.js View on Github external
export default (parsed, when = 'never') => {
	const negated = when === 'always';
	const notEmpty = ensure.notEmpty(parsed.scope);
	return [
		negated ? !notEmpty : notEmpty,
		message(['scope', negated ? 'must' : 'may not', 'be empty'])
	];
};
github conventional-changelog / commitlint / @commitlint / rules / src / subject-empty.js View on Github external
export default (parsed, when) => {
	const negated = when === 'never';
	const notEmpty = ensure.notEmpty(parsed.subject);

	return [
		negated ? notEmpty : !notEmpty,
		message(['subject', negated ? 'may not' : 'must', 'be empty'])
	];
};