Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: simplify config resolution #2398

Merged
merged 25 commits into from
Nov 16, 2021
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d315e02
feat: basic user config validation
armano2 Jan 10, 2021
a9477b8
fix: simplify config resolution and fix issue #327
armano2 Jan 10, 2021
01ef361
fix: remove no longer needed function
armano2 Jan 10, 2021
e09fc01
fix: disable some unwanted validations
armano2 Jan 10, 2021
26612a8
fix: improve config validation
armano2 Jan 10, 2021
fb7064c
fix: remove redundant validation
armano2 Jan 10, 2021
b0d4829
fix: use reduceRight instead of reverse
armano2 Jan 10, 2021
ff67ad7
fix: rollback some code
armano2 Jan 10, 2021
3bd8384
fix: drop invalid type casts
armano2 Jan 10, 2021
7fcf5e0
fix: rollback unnecessary changes
armano2 Jan 10, 2021
5a10589
fix: rollback config validation
armano2 Jan 15, 2021
b2af2e0
fix: add missing type-guards and restore order
armano2 Jan 15, 2021
a165e15
fix: one more order change
armano2 Jan 15, 2021
28185b6
fix: add one more missing type guard
armano2 Jan 15, 2021
0c75eb9
fix: remove unused types reference
armano2 Jan 15, 2021
45d1e25
fix: add additional unit tests
armano2 Jan 16, 2021
75d9011
fix: add additional regression tests
armano2 Jan 16, 2021
bd6e958
fix: remove more unnecessary code changes
armano2 Jan 16, 2021
9303234
fix: correct order of merging plugins
armano2 Jan 16, 2021
1e20607
fix: add missing type check
armano2 Jan 16, 2021
b750743
fix: remove invalid type check
armano2 Jan 17, 2021
1c251d2
fix: remove redundant code
armano2 Jan 17, 2021
f1bf2d2
fix: rollback some unnecessary changes
armano2 Jan 29, 2021
2c32314
fix: optimize loadParserOpts
armano2 Jan 29, 2021
19b76c1
Merge branch 'master' into refactor/load
armano2 Nov 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add missing type-guards and restore order
armano2 committed Jan 30, 2021
commit b2af2e0cbf1f30bc7d332bdcf6647a9abb6d25f9
18 changes: 9 additions & 9 deletions @commitlint/load/src/load.ts
Original file line number Diff line number Diff line change
@@ -70,6 +70,15 @@ export default async function load(
}
});

if (!extended.formatter || typeof extended.formatter !== 'string') {
extended.formatter = '@commitlint/format';
}

if (!extended.helpUrl || typeof extended.helpUrl !== 'string') {
extended.helpUrl =
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint';
}

const rules = (
await Promise.all(
Object.entries(extended.rules || {}).map((entry) => executeRule(entry))
@@ -81,15 +90,6 @@ export default async function load(
return registry;
}, {});

if (!extended.formatter) {
extended.formatter = '@commitlint/format';
}

if (!extended.helpUrl) {
extended.helpUrl =
'https://github.com/conventional-changelog/commitlint/#what-is-commitlint';
}

return {
// TODO: check if this is still necessary with the new factory based conventional changelog parsers
// TODO: should this function return this? as those values are already resolved