diff --git a/bin/lint-staged.js b/bin/lint-staged.js index 7b52b0899..1383a3933 100755 --- a/bin/lint-staged.js +++ b/bin/lint-staged.js @@ -44,10 +44,13 @@ cmdline ) .parse(process.argv) -const debugLog = debug('lint-staged:bin') -if (cmdline.debug) { +const cmdlineOptions = cmdline.opts() + +if (cmdlineOptions.debug) { debug.enable('lint-staged*') } + +const debugLog = debug('lint-staged:bin') debugLog('Running `lint-staged@%s`', version) /** @@ -68,8 +71,6 @@ const getMaxArgLength = () => { } } -const cmdlineOptions = cmdline.opts() - const options = { allowEmpty: !!cmdlineOptions.allowEmpty, concurrent: JSON.parse(cmdlineOptions.concurrent),