diff --git a/@commitlint/core/src/library/is-ignored.js b/@commitlint/core/src/library/is-ignored.js index b90f6b1ab9..9ef99f7220 100644 --- a/@commitlint/core/src/library/is-ignored.js +++ b/@commitlint/core/src/library/is-ignored.js @@ -12,6 +12,7 @@ const WILDCARDS = [ c .split('\n') .shift() + .replace(/^chore(\([^)]+\))?:/, '') .trim() ) ]; diff --git a/@commitlint/core/src/library/is-ignored.test.js b/@commitlint/core/src/library/is-ignored.test.js index 13ed035b2f..5c794d8584 100644 --- a/@commitlint/core/src/library/is-ignored.test.js +++ b/@commitlint/core/src/library/is-ignored.test.js @@ -68,6 +68,13 @@ test('should ignore npm semver commits', t => { VERSION_MESSAGES.forEach(message => t.true(isIgnored(message))); }); +test('should ignore npm semver commits with chore', t => { + VERSION_MESSAGES.forEach(message => t.true(isIgnored(`chore: ${message}`))); + VERSION_MESSAGES.forEach(message => + t.true(isIgnored(`chore(release): ${message}`)) + ); +}); + test('should ignore npm semver commits with footers', t => { AMENDED_VERSION_MESSAGES.forEach(message => t.true(isIgnored(message))); });