Skip to content

Commit

Permalink
refactor(cli): use camelCase cli flag names
Browse files Browse the repository at this point in the history
  • Loading branch information
armano2 committed Feb 9, 2020
1 parent 310fb28 commit 4488113
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions @commitlint/cli/src/cli.ts
Expand Up @@ -56,7 +56,7 @@ const cli = yargs
description: 'array of shareable configurations to extend',
type: 'array'
},
'help-url': {
helpUrl: {
alias: 'H',
type: 'string',
description: 'helpurl in error message'
Expand All @@ -72,7 +72,7 @@ const cli = yargs
description: 'output format of the results',
type: 'string'
},
'parser-preset': {
parserPreset: {
alias: 'p',
description:
'configuration preset to use for conventional-commits-parser',
Expand Down Expand Up @@ -231,8 +231,8 @@ async function main(options: CliFlags) {
const output = format(report, {
color: flags.color,
verbose: flags.verbose,
helpUrl: flags['help-url']
? flags['help-url'].trim()
helpUrl: flags.helpUrl
? flags.helpUrl.trim()
: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'
});

Expand Down Expand Up @@ -317,13 +317,13 @@ function getEditValue(flags: CliFlags) {
return edit;
}

function getSeed(seed: CliFlags): Seed {
const n = (seed.extends || []).filter(
function getSeed(flags: CliFlags): Seed {
const n = (flags.extends || []).filter(
(i): i is string => typeof i === 'string'
);
return n.length > 0
? {extends: n, parserPreset: seed['parser-preset']}
: {parserPreset: seed['parser-preset']};
? {extends: n, parserPreset: flags.parserPreset}
: {parserPreset: flags.parserPreset};
}

function selectParserOpts(parserPreset: ParserPreset) {
Expand Down
4 changes: 2 additions & 2 deletions @commitlint/cli/src/types.ts
Expand Up @@ -6,10 +6,10 @@ export interface CliFlags {
env?: string;
extends?: (string | number)[];
help?: boolean;
'help-url'?: string;
helpUrl?: string;
from?: string;
format?: string;
'parser-preset'?: string;
parserPreset?: string;
quiet: boolean;
to?: string;
version?: boolean;
Expand Down

0 comments on commit 4488113

Please sign in to comment.