From f8a026140d477f906083ae90ffb383ad0c0807a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iiro=20Ja=CC=88ppinen?= Date: Fri, 7 May 2021 09:10:41 +0300 Subject: [PATCH] fix: migrate commander@7 --- bin/lint-staged.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/bin/lint-staged.js b/bin/lint-staged.js index 2ed7e051f..a6fe89754 100755 --- a/bin/lint-staged.js +++ b/bin/lint-staged.js @@ -74,17 +74,19 @@ const getMaxArgLength = () => { } } +const cmdlineOptions = cmdline.opts() + const options = { - allowEmpty: !!cmdline.allowEmpty, - concurrent: JSON.parse(cmdline.concurrent), - configPath: cmdline.config, - debug: !!cmdline.debug, + allowEmpty: !!cmdlineOptions.allowEmpty, + concurrent: JSON.parse(cmdlineOptions.concurrent), + configPath: cmdlineOptions.config, + debug: !!cmdlineOptions.debug, maxArgLength: getMaxArgLength() / 2, - stash: !!cmdline.stash, // commander inverts `no-` flags to `!x` - quiet: !!cmdline.quiet, - relative: !!cmdline.relative, - shell: !!cmdline.shell, - verbose: !!cmdline.verbose, + stash: !!cmdlineOptions.stash, // commander inverts `no-` flags to `!x` + quiet: !!cmdlineOptions.quiet, + relative: !!cmdlineOptions.relative, + shell: !!cmdlineOptions.shell, + verbose: !!cmdlineOptions.verbose, } debug('Options parsed from command-line:', options)