Skip to content

Commit 0063261

Browse files
committed
style: prettierrc code
1 parent 113874b commit 0063261

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

scripts/verify-commit.js

+15-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
const chalk = require("chalk")
1+
// eslint-disable-next-line @typescript-eslint/no-var-requires
2+
const chalk = require("chalk");
23

3-
const msgPath = process.env.HUSKY_GIT_PARAMS
4-
const msg = require("fs").readFileSync(msgPath, "utf-8").trim()
4+
const msgPath = process.env.HUSKY_GIT_PARAMS;
5+
// eslint-disable-next-line @typescript-eslint/no-var-requires
6+
const msg = require("fs").readFileSync(msgPath, "utf-8").trim();
57

6-
const commitRE = /^(revert: )?(feat|fix|polish|docs|style|refactor|perf|test|workflow|ci|chore|types)(\(.+\))?: .{1,50}/
8+
const commitRE =
9+
/^(revert: )?(feat|fix|polish|docs|style|refactor|perf|test|workflow|ci|chore|types)(\(.+\))?: .{1,50}/;
710

811
if (!commitRE.test(msg)) {
912
console.error(
1013
` ${chalk.bgRed.white(" ERROR ")} ${chalk.red(
1114
"不合法的 commit 消息格式"
1215
)}\n\n` +
13-
chalk.red(" 请使用正确的提交格式:\n\n") +
14-
` ${chalk.green("feat: add 'comments' option")}\n` +
15-
` ${chalk.green("fix: handle events on blur (close #28)")}\n\n` +
16-
chalk.red(
17-
" 请查看 git commit 提交规范:https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md \n"
18-
)
19-
)
16+
chalk.red(" 请使用正确的提交格式:\n\n") +
17+
` ${chalk.green("feat: add 'comments' option")}\n` +
18+
` ${chalk.green("fix: handle events on blur (close #28)")}\n\n` +
19+
chalk.red(
20+
" 请查看 git commit 提交规范:https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md \n"
21+
)
22+
);
2023

21-
process.exit(1)
24+
process.exit(1);
2225
}

0 commit comments

Comments
 (0)