@@ -17,6 +17,7 @@ import { gitCommit } from "./command/git-commit";
17
17
import { gitInitSimpleHooks } from "./command/git-init-hooks" ;
18
18
import { clear } from "./command/clear" ;
19
19
import { npmRun } from "./command/npm-run" ;
20
+ import { npmDepCheck } from "./command/npm-dep-check" ;
20
21
21
22
export const commandSet : CommandSet = {
22
23
gitCommitCmd : ( cli : CAC ) => {
@@ -30,14 +31,14 @@ export const commandSet: CommandSet = {
30
31
} ) ;
31
32
} ) ;
32
33
} ,
33
- gitCommitVerifySetup : ( cli : CAC ) => {
34
+ gitCommitVerifyCmd : ( cli : CAC ) => {
34
35
cli
35
36
. command ( "verify" , "校验 COMMIT_EDITMSG 中的信息是否符合 Angualr 规范" )
36
37
. action ( async ( ) => {
37
38
await gitCommitVerify ( ) ;
38
39
} ) ;
39
40
} ,
40
- clearSetup : ( cli : CAC ) => {
41
+ clearCmd : ( cli : CAC ) => {
41
42
cli
42
43
. command ( "clear" , "运行 rimraf 删除不再需要的文件或文件夹" )
43
44
. option ( "-p, --pattern <pattern>" , "设置配置规则" , {
@@ -51,22 +52,32 @@ export const commandSet: CommandSet = {
51
52
await clear ( patterns ) ;
52
53
} ) ;
53
54
} ,
54
- initSimpleGitHooks : ( cli : CAC ) => {
55
+ initSimpleGitHooksCmd : ( cli : CAC ) => {
55
56
cli
56
57
. command ( "hooks" , "新增或修改 simple-git-hooks 配置后需要重新初始化" )
57
58
. action ( async ( ) => {
58
59
await gitInitSimpleHooks ( ) ;
59
60
} ) ;
60
61
} ,
61
- npmRunSetup : ( cli : CAC ) => {
62
+ npmDepCheck : ( cli : CAC ) => {
63
+ cli
64
+ . command (
65
+ "depcheck" ,
66
+ "运行 npm-check 检查过时的、不正确的和未使用的依赖项" ,
67
+ )
68
+ . action ( async ( ) => {
69
+ await npmDepCheck ( ) ;
70
+ } ) ;
71
+ } ,
72
+ npmRunCmd : ( cli : CAC ) => {
62
73
cli . command ( "run" , "列出可以运行的全部脚本" ) . action ( async ( ) => {
63
74
await npmRun ( ) ;
64
75
} ) ;
65
76
} ,
66
- eslintFix : ( cli : CAC ) => {
77
+ eslintFixCmd : ( cli : CAC ) => {
67
78
cli
68
79
. command ( "fix" , "运行 eslint 静态扫描和修复代码中存在的问题" )
69
- . option ( "-p, --pattern <pattern>" , "设置配置规则 " , {
80
+ . option ( "-p, --pattern <pattern>" , "设置匹配规则 " , {
70
81
default : [ ...eslintGlob ] ,
71
82
} )
72
83
. action ( async ( options ) => {
@@ -77,10 +88,10 @@ export const commandSet: CommandSet = {
77
88
await eslintFix ( patterns ) ;
78
89
} ) ;
79
90
} ,
80
- prettierFormat : ( cli : CAC ) => {
91
+ prettierFormatCmd : ( cli : CAC ) => {
81
92
cli
82
93
. command ( "format" , "运行 prettier 格式化代码风格" )
83
- . option ( "-p, --pattern <pattern>" , "设置配置规则 " , {
94
+ . option ( "-p, --pattern <pattern>" , "设置匹配规则 " , {
84
95
default : [ ...formatGlob ] ,
85
96
} )
86
97
. action ( async ( options ) => {
0 commit comments