Skip to content

Commit 4488113

Browse files
committed
refactor(cli): use camelCase cli flag names
1 parent 310fb28 commit 4488113

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

@commitlint/cli/src/cli.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const cli = yargs
5656
description: 'array of shareable configurations to extend',
5757
type: 'array'
5858
},
59-
'help-url': {
59+
helpUrl: {
6060
alias: 'H',
6161
type: 'string',
6262
description: 'helpurl in error message'
@@ -72,7 +72,7 @@ const cli = yargs
7272
description: 'output format of the results',
7373
type: 'string'
7474
},
75-
'parser-preset': {
75+
parserPreset: {
7676
alias: 'p',
7777
description:
7878
'configuration preset to use for conventional-commits-parser',
@@ -231,8 +231,8 @@ async function main(options: CliFlags) {
231231
const output = format(report, {
232232
color: flags.color,
233233
verbose: flags.verbose,
234-
helpUrl: flags['help-url']
235-
? flags['help-url'].trim()
234+
helpUrl: flags.helpUrl
235+
? flags.helpUrl.trim()
236236
: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint'
237237
});
238238

@@ -317,13 +317,13 @@ function getEditValue(flags: CliFlags) {
317317
return edit;
318318
}
319319

320-
function getSeed(seed: CliFlags): Seed {
321-
const n = (seed.extends || []).filter(
320+
function getSeed(flags: CliFlags): Seed {
321+
const n = (flags.extends || []).filter(
322322
(i): i is string => typeof i === 'string'
323323
);
324324
return n.length > 0
325-
? {extends: n, parserPreset: seed['parser-preset']}
326-
: {parserPreset: seed['parser-preset']};
325+
? {extends: n, parserPreset: flags.parserPreset}
326+
: {parserPreset: flags.parserPreset};
327327
}
328328

329329
function selectParserOpts(parserPreset: ParserPreset) {

@commitlint/cli/src/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export interface CliFlags {
66
env?: string;
77
extends?: (string | number)[];
88
help?: boolean;
9-
'help-url'?: string;
9+
helpUrl?: string;
1010
from?: string;
1111
format?: string;
12-
'parser-preset'?: string;
12+
parserPreset?: string;
1313
quiet: boolean;
1414
to?: string;
1515
version?: boolean;

0 commit comments

Comments
 (0)