Skip to content

Commit

Permalink
fix(parser): add support for --single-quote
Browse files Browse the repository at this point in the history
Closes #60
  • Loading branch information
Kent C. Dodds committed May 22, 2017
1 parent d68ae4f commit 0553fe7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cli-test/tests/index.js
Expand Up @@ -28,7 +28,7 @@ test('help outputs usage information and flags', async () => {
expect(stdout).toContain('Options:\n')
// just a sanity check.
// If it's ever longer than 2000 then we've probably got a problem...
if (stdout.length > 4100) {
if (stdout.length > 6000) {
console.error(stdout)
throw new Error(
oneLine`
Expand Down
25 changes: 18 additions & 7 deletions src/parser.js
Expand Up @@ -108,7 +108,8 @@ const parser = yargs
'bracket-spacing': {
default: true,
type: 'boolean',
describe: stripIndent`Print spaces between brackets in object literals.
describe: stripIndent`
Print spaces between brackets in object literals.
Can use --no-bracket-spacing for "false" to disable it.
Valid options:
Expand All @@ -133,15 +134,25 @@ const parser = yargs
semi: {
default: true,
type: 'boolean',
describe: stripIndent`Print semicolons at the ends of statements.
Can use --no-semi to be compatible with StandardJS.
describe: stripIndent`
Print semicolons at the ends of statements.
Can use --no-semi.
Valid options:
- true - add a semicolon at the end of every statement
- false - only add semicolons at the beginning of lines
that may introduce ASI failures
`,
- true - add a semicolon at the end of every statement
- false - ${oneLine`
only add semicolons at the beginning of lines
that may introduce ASI failures
`}
`,
},
'single-quote': {
default: false,
type: 'boolean',
describe: 'Use single quotes instead of double quotes.',
},
// TODO: support range-start and range-end
// would require changes in prettier-eslint
// 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 Down

0 comments on commit 0553fe7

Please sign in to comment.