From 1db5f2651d7f41c56f3ee1eacb57f1be1566bce2 Mon Sep 17 00:00:00 2001 From: Ilia_Khrebtov Date: Tue, 24 May 2022 13:58:55 +0500 Subject: [PATCH] fix: correctly handle --max-arg-length cli option --- bin/lint-staged.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/lint-staged.js b/bin/lint-staged.js index de0ca6e5f..a57f26e51 100755 --- a/bin/lint-staged.js +++ b/bin/lint-staged.js @@ -34,7 +34,7 @@ cmdline .option('-c, --config [path]', 'path to configuration file, or - to read from stdin') .option('--cwd [path]', 'run all tasks in specific directory, instead of the current') .option('-d, --debug', 'print additional debug information', false) - .option('--max-arg-length', 'maximum length of the command-line argument string') + .option('--max-arg-length [number]', 'maximum length of the command-line argument string', 0) .option('--no-stash', 'disable the backup stash, and do not revert in case of errors', false) .option('-q, --quiet', 'disable lint-staged’s own console output', false) .option('-r, --relative', 'pass relative filepaths to tasks', false) @@ -61,7 +61,7 @@ const options = { configPath: cmdlineOptions.config, cwd: cmdlineOptions.cwd, debug: !!cmdlineOptions.debug, - maxArgLength: JSON.parse(cmdlineOptions.maxArgLength || null), + maxArgLength: cmdlineOptions.maxArgLength || undefined, quiet: !!cmdlineOptions.quiet, relative: !!cmdlineOptions.relative, shell: cmdlineOptions.shell /* Either a boolean or a string pointing to the shell */,