Skip to content

Commit

Permalink
fix(options): make boolean options boolean
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Kent C. Dodds committed Feb 14, 2017
1 parent 99cc133 commit 7e94e91
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -33,6 +37,7 @@ const parser = yargs
sillyLogs: {
default: false,
describe: 'Show silly amount of logs (good for debugging)',
type: 'boolean',
},
})

Expand Down

0 comments on commit 7e94e91

Please sign in to comment.