From 7e94e91e786a6cfe017df61da2bcdf347974ef26 Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Tue, 14 Feb 2017 07:01:54 -0700 Subject: [PATCH] fix(options): make boolean options boolean as it was, the options were taking anything after them as the value which lead to people saying `prettier-eslint --write "directory/**/*.js"` and nothing happening --- src/parser.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/parser.js b/src/parser.js index a9733b8..c4f5ad5 100644 --- a/src/parser.js +++ b/src/parser.js @@ -8,14 +8,18 @@ const parser = yargs .alias('h', 'help') .version() .options({ - write: {default: false, describe: 'Edit the file in-place (beware!)'}, - stdin: {default: false, describe: 'Read input via stdin'}, + write: { + default: false, + describe: 'Edit the file in-place (beware!)', + type: 'boolean', + }, + stdin: {default: false, describe: 'Read input via stdin', type: 'boolean'}, eslintPath: { default: getPathInHostNodeModules('eslint'), describe: 'The path to the eslint module to use', }, prettierPath: {describe: 'The path to the prettier module to use'}, - log: {default: false, describe: 'Show logs'}, + log: {default: false, describe: 'Show logs', type: 'boolean'}, // TODO: if we allow people to to specify a config path, // we need to read that somehow. These can come invarious // formats and we'd have to work out `extends` somehow as well. @@ -33,6 +37,7 @@ const parser = yargs sillyLogs: { default: false, describe: 'Show silly amount of logs (good for debugging)', + type: 'boolean', }, })