Skip to content

Commit 1db5f26

Browse files
Ilia_Khrebtoviiroj
authored andcommitted
fix: correctly handle --max-arg-length cli option
1 parent f0536dc commit 1db5f26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/lint-staged.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cmdline
3434
.option('-c, --config [path]', 'path to configuration file, or - to read from stdin')
3535
.option('--cwd [path]', 'run all tasks in specific directory, instead of the current')
3636
.option('-d, --debug', 'print additional debug information', false)
37-
.option('--max-arg-length', 'maximum length of the command-line argument string')
37+
.option('--max-arg-length [number]', 'maximum length of the command-line argument string', 0)
3838
.option('--no-stash', 'disable the backup stash, and do not revert in case of errors', false)
3939
.option('-q, --quiet', 'disable lint-staged’s own console output', false)
4040
.option('-r, --relative', 'pass relative filepaths to tasks', false)
@@ -61,7 +61,7 @@ const options = {
6161
configPath: cmdlineOptions.config,
6262
cwd: cmdlineOptions.cwd,
6363
debug: !!cmdlineOptions.debug,
64-
maxArgLength: JSON.parse(cmdlineOptions.maxArgLength || null),
64+
maxArgLength: cmdlineOptions.maxArgLength || undefined,
6565
quiet: !!cmdlineOptions.quiet,
6666
relative: !!cmdlineOptions.relative,
6767
shell: cmdlineOptions.shell /* Either a boolean or a string pointing to the shell */,

0 commit comments

Comments
 (0)