Skip to content

Commit 25b98f8

Browse files
committed
fix: add missing type-guards and restore order
1 parent a76e70e commit 25b98f8

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

@commitlint/load/src/load.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ export default async function load(
7070
}
7171
});
7272

73+
if (!extended.formatter || typeof extended.formatter !== 'string') {
74+
extended.formatter = '@commitlint/format';
75+
}
76+
77+
if (!extended.helpUrl || typeof extended.helpUrl !== 'string') {
78+
extended.helpUrl =
79+
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint';
80+
}
81+
7382
const rules = (
7483
await Promise.all(
7584
Object.entries(extended.rules || {}).map((entry) => executeRule(entry))
@@ -81,15 +90,6 @@ export default async function load(
8190
return registry;
8291
}, {});
8392

84-
if (!extended.formatter) {
85-
extended.formatter = '@commitlint/format';
86-
}
87-
88-
if (!extended.helpUrl) {
89-
extended.helpUrl =
90-
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint';
91-
}
92-
9393
return {
9494
// TODO: check if this is still necessary with the new factory based conventional changelog parsers
9595
// TODO: should this function return this? as those values are already resolved

0 commit comments

Comments
 (0)