@@ -56,14 +56,13 @@ program
56
56
. option ( '--no-types' , 'do not build types target' )
57
57
. action ( ( ...args ) => {
58
58
const cmd = getCommand ( args ) ;
59
- const rest = getPositionalArgs ( args ) ;
60
59
const { esm, types, cjs } = getOpts ( cmd ) ;
61
60
const t : BuildTaskDesc = {
62
61
name : 'build' ,
63
62
esm,
64
63
types,
65
64
cjs,
66
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
65
+ restOptions : parseRestOptions ( cmd ) ,
67
66
} ;
68
67
69
68
handlePromiseResult ( buildTask ( t ) ) ;
@@ -76,12 +75,11 @@ program
76
75
. option ( '--config [path]' , 'path to jest config' )
77
76
. action ( ( ...args ) => {
78
77
const cmd = getCommand ( args ) ;
79
- const rest = getPositionalArgs ( args ) ;
80
78
const { config } = getOpts ( cmd ) ;
81
79
const t : TestTaskDesc = {
82
80
name : 'test' ,
83
81
config,
84
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
82
+ restOptions : parseRestOptions ( cmd ) ,
85
83
} ;
86
84
87
85
const result = testTask ( t ) ;
@@ -99,14 +97,13 @@ program
99
97
. option ( '--no-stylecheck' , "do not run Prettier's style check" )
100
98
. action ( ( ...args ) => {
101
99
const cmd = getCommand ( args ) ;
102
- const rest = getPositionalArgs ( args ) ;
103
100
const { stylecheck, typecheck, config } = getOpts ( cmd ) ;
104
101
const t : LintTaskDesc = {
105
102
name : 'lint' ,
106
103
config,
107
104
stylecheck,
108
105
typecheck,
109
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
106
+ restOptions : parseRestOptions ( cmd ) ,
110
107
} ;
111
108
112
109
handlePromiseResult ( lintTask ( t ) ) ;
@@ -123,13 +120,12 @@ program
123
120
)
124
121
. action ( ( ...args ) => {
125
122
const cmd = getCommand ( args ) ;
126
- const rest = getPositionalArgs ( args ) ;
127
123
const { config, path } = getOpts ( cmd ) ;
128
124
const t : FormatTaskDesc = {
129
125
name : 'format' ,
130
126
config,
131
127
path,
132
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
128
+ restOptions : parseRestOptions ( cmd ) ,
133
129
} ;
134
130
135
131
handleSpawnResult ( formatTask ( t ) ) ;
@@ -146,7 +142,6 @@ program
146
142
. option ( '--no-typecheck' , 'Do not type check using TypeScript' )
147
143
. action ( ( ...args ) => {
148
144
const cmd = getCommand ( args ) ;
149
- const rest = getPositionalArgs ( args ) ;
150
145
const {
151
146
tests,
152
147
typecheck,
@@ -161,7 +156,7 @@ program
161
156
jestConfig,
162
157
eslintConfig,
163
158
prettierConfig,
164
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
159
+ restOptions : parseRestOptions ( cmd ) ,
165
160
} ;
166
161
167
162
handlePromiseResult ( precommitTask ( t ) ) ;
@@ -195,12 +190,11 @@ program
195
190
)
196
191
. action ( ( ...args ) => {
197
192
const cmd = getCommand ( args ) ;
198
- const rest = getPositionalArgs ( args ) ;
199
193
const { threshold } = getOpts ( cmd ) ;
200
194
const t : AuditTaskDesc = {
201
195
name : 'audit' ,
202
196
threshold,
203
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
197
+ restOptions : parseRestOptions ( cmd ) ,
204
198
} ;
205
199
206
200
handlePromiseResult ( auditTask ( t ) ) ;
@@ -217,12 +211,11 @@ program
217
211
)
218
212
. action ( ( ...args ) => {
219
213
const cmd = getCommand ( args ) ;
220
- const rest = getPositionalArgs ( args ) ;
221
214
const { path } = getOpts ( cmd ) ;
222
215
const t : CommitTaskDesc = {
223
216
name : 'commit' ,
224
217
path,
225
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
218
+ restOptions : parseRestOptions ( cmd ) ,
226
219
} ;
227
220
228
221
try {
@@ -243,12 +236,11 @@ program
243
236
)
244
237
. action ( ( ...args ) => {
245
238
const cmd = getCommand ( args ) ;
246
- const rest = getPositionalArgs ( args ) ;
247
239
const { config } = getOpts ( cmd ) ;
248
240
const t : CommitMsgTaskDesc = {
249
241
name : 'commitmsg' ,
250
242
config,
251
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
243
+ restOptions : parseRestOptions ( cmd ) ,
252
244
} ;
253
245
254
246
handleSpawnResult ( commitMsgTask ( t ) ) ;
@@ -260,10 +252,9 @@ program
260
252
. description ( 'Run semantic-release' )
261
253
. action ( ( ...args ) => {
262
254
const cmd = getCommand ( args ) ;
263
- const rest = getPositionalArgs ( args ) ;
264
255
const t : ReleaseTaskDesc = {
265
256
name : 'release' ,
266
- restOptions : [ ... parseRestOptions ( cmd ) , ... rest ] ,
257
+ restOptions : parseRestOptions ( cmd ) ,
267
258
} ;
268
259
269
260
handleSpawnResult ( releaseTask ( t ) ) ;
@@ -297,10 +288,6 @@ function getCommand(args: any[]): Command {
297
288
return args [ 0 ] as Command ;
298
289
}
299
290
300
- function getPositionalArgs ( args : any [ ] ) : string [ ] {
301
- return args . slice ( 1 ) as string [ ] ;
302
- }
303
-
304
291
function getOpts ( cmd : Command ) : { [ key : string ] : any } {
305
292
return cmd . opts ( ) ;
306
293
}
0 commit comments