File tree 1 file changed +15
-12
lines changed
1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
- const chalk = require ( "chalk" )
1
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
2
+ const chalk = require ( "chalk" ) ;
2
3
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 ( ) ;
5
7
6
- const commitRE = / ^ ( r e v e r t : ) ? ( f e a t | f i x | p o l i s h | d o c s | s t y l e | r e f a c t o r | p e r f | t e s t | w o r k f l o w | c i | c h o r e | t y p e s ) ( \( .+ \) ) ? : .{ 1 , 50 } /
8
+ const commitRE =
9
+ / ^ ( r e v e r t : ) ? ( f e a t | f i x | p o l i s h | d o c s | s t y l e | r e f a c t o r | p e r f | t e s t | w o r k f l o w | c i | c h o r e | t y p e s ) ( \( .+ \) ) ? : .{ 1 , 50 } / ;
7
10
8
11
if ( ! commitRE . test ( msg ) ) {
9
12
console . error (
10
13
` ${ chalk . bgRed . white ( " ERROR " ) } ${ chalk . red (
11
14
"不合法的 commit 消息格式"
12
15
) } \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
+ ) ;
20
23
21
- process . exit ( 1 )
24
+ process . exit ( 1 ) ;
22
25
}
You can’t perform that action at this time.
0 commit comments