diff --git a/packages/vant-cli/src/commands/commit-lint.ts b/packages/vant-cli/src/commands/commit-lint.ts index f0c732823..2685b99ff 100644 --- a/packages/vant-cli/src/commands/commit-lint.ts +++ b/packages/vant-cli/src/commands/commit-lint.ts @@ -2,12 +2,13 @@ import signale from 'signale'; import { readFileSync } from 'fs'; const commitRE = /^(revert: )?(fix|feat|docs|perf|test|types|build|chore|refactor|breaking change)(\(.+\))?: .{1,50}/; +const mergeRE = /Merge branch /; export function commitLint() { const gitParams = process.env.HUSKY_GIT_PARAMS as string; const commitMsg = readFileSync(gitParams, 'utf-8').trim(); - if (!commitRE.test(commitMsg)) { + if (!commitRE.test(commitMsg) || !mergeRE.test(commitMsg)) { signale.error(`Error: invalid commit message: "${commitMsg}". Proper commit message format is required for automated changelog generation. @@ -30,6 +31,7 @@ Allowed Types: - chore - refactor - breaking change +- Merge branch 'foo' into 'bar' `); process.exit(1); } diff --git a/packages/vant-cli/src/commands/dev.ts b/packages/vant-cli/src/commands/dev.ts index 780d87636..8e8b8bc0b 100644 --- a/packages/vant-cli/src/commands/dev.ts +++ b/packages/vant-cli/src/commands/dev.ts @@ -1,4 +1,3 @@ - import { clean } from '../commands/clean'; import { setNodeEnv } from '../common'; import { compileSite } from '../compiler/compile-site';