@@ -22,6 +22,8 @@ import type { RangeStyle } from '../../utils/semver.mts'
22
22
23
23
const { DRY_RUN_NOT_SAVING } = constants
24
24
25
+ const DEFAULT_LIMIT = 10
26
+
25
27
const config : CliCommandConfig = {
26
28
commandName : 'fix' ,
27
29
description : 'Update dependencies with "fixable" Socket alerts' ,
@@ -53,8 +55,8 @@ const config: CliCommandConfig = {
53
55
} ,
54
56
limit : {
55
57
type : 'number' ,
56
- default : Infinity ,
57
- description : ' The number of fixes to attempt at a time' ,
58
+ default : DEFAULT_LIMIT ,
59
+ description : ` The number of fixes to attempt at a time (default ${ DEFAULT_LIMIT } )` ,
58
60
} ,
59
61
maxSatisfying : {
60
62
type : 'boolean' ,
@@ -88,7 +90,7 @@ const config: CliCommandConfig = {
88
90
type : 'string' ,
89
91
default : 'preserve' ,
90
92
description : `
91
- Define how updated dependency versions should be written in package.json.
93
+ Define how dependency version ranges are updated in package.json (default 'preserve') .
92
94
Available styles:
93
95
* caret - Use ^ range for compatible updates (e.g. ^1.2.3)
94
96
* gt - Use > to allow any newer version (e.g. >1.2.3)
@@ -108,7 +110,7 @@ const config: CliCommandConfig = {
108
110
testScript : {
109
111
type : 'string' ,
110
112
default : 'test' ,
111
- description : 'The test script to run for each fix attempt' ,
113
+ description : 'The test script to run for each fix attempt (default \'test\') ' ,
112
114
} ,
113
115
} ,
114
116
help : ( command , config ) => `
@@ -214,10 +216,7 @@ async function run(
214
216
const unknownFlags = cli . unknownFlags ?? [ ]
215
217
216
218
const ghsas = cmdFlagValueToArray ( cli . flags [ 'ghsa' ] )
217
- const limit =
218
- ( cli . flags [ 'limit' ]
219
- ? parseInt ( String ( cli . flags [ 'limit' ] || '' ) , 10 )
220
- : Infinity ) || Infinity
219
+ const limit = Number ( cli . flags [ 'limit' ] ) || DEFAULT_LIMIT
221
220
const maxSatisfying = Boolean ( cli . flags [ 'maxSatisfying' ] )
222
221
const minSatisfying = Boolean ( cli . flags [ 'minSatisfying' ] ) || ! maxSatisfying
223
222
const prCheck = Boolean ( cli . flags [ 'prCheck' ] )
0 commit comments