Skip to content

Commit c717202

Browse files
authoredNov 29, 2021
feat: config validation (#2412)
* feat: basic user config validation * fix: simplify config resolution and fix issue #327 * fix: remove no longer needed function * fix: disable some unwanted validations * fix: improve config validation * fix: remove redundant validation * fix: use reduceRight instead of reverse * fix: rollback some code * fix: drop invalid type casts * fix: rollback unnecessary changes * fix: rollback config validation * fix: add missing type-guards and restore order * fix: one more order change * fix: add one more missing type guard * fix: remove unused types reference * fix: add additional unit tests * fix: add additional regression tests - remove also unnecessary type check * fix: remove more unnecessary code changes * fix: correct order of merging plugins * fix: add missing type check * fix: remove invalid type check * fix: remove redundant code * feat: implement config validation * fix: allow to use function as a rule
1 parent fc5d869 commit c717202

File tree

45 files changed

+693
-2024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+693
-2024
lines changed
 

‎@commitlint/cli/src/cli.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import resolveGlobal from 'resolve-global';
77
import yargs, {Arguments} from 'yargs';
88
import util from 'util';
99

10-
import {CliFlags, Seed} from './types';
10+
import {CliFlags} from './types';
1111
import {
1212
LintOptions,
1313
LintOutcome,
1414
ParserOptions,
1515
ParserPreset,
1616
QualifiedConfig,
1717
Formatter,
18+
UserConfig,
1819
} from '@commitlint/types';
1920
import {CliError} from './cli-error';
2021

@@ -364,7 +365,7 @@ function getEditValue(flags: CliFlags) {
364365
return edit;
365366
}
366367

367-
function getSeed(flags: CliFlags): Seed {
368+
function getSeed(flags: CliFlags): UserConfig {
368369
const n = (flags.extends || []).filter(
369370
(i): i is string => typeof i === 'string'
370371
);

‎@commitlint/cli/src/types.ts

-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,3 @@ export interface CliFlags {
1818
_: (string | number)[];
1919
$0: string;
2020
}
21-
22-
export interface Seed {
23-
extends?: string[];
24-
parserPreset?: string;
25-
}

0 commit comments

Comments
 (0)
Please sign in to comment.