Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
162 changes: 81 additions & 81 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
},
"devDependencies": {
"@ava/typescript": "6.0.0",
"@commitlint/cli": "20.3.0",
"@commitlint/config-conventional": "20.3.0",
"@commitlint/cli": "20.3.1",
"@commitlint/config-conventional": "20.3.1",
"@commitlint/lint-19.x": "npm:@commitlint/lint@19.8.1",
"@commitlint/lint-20.x": "npm:@commitlint/lint@20.3.0",
"@commitlint/lint-20.x": "npm:@commitlint/lint@20.3.1",
"@commitlint/load-19.x": "npm:@commitlint/load@19.8.1",
"@commitlint/load-20.x": "npm:@commitlint/load@20.3.0",
"@commitlint/rules": "20.3.0",
"@commitlint/types": "20.2.0",
"@commitlint/load-20.x": "npm:@commitlint/load@20.3.1",
"@commitlint/rules": "20.3.1",
"@commitlint/types": "20.3.1",
"@types/sinon": "21.0.0",
"@vidavidorra/eslint-config": "1.0.3",
"@vidavidorra/prettier-config": "1.0.6",
Expand Down
13 changes: 12 additions & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ const loadPlugin = test.macro<[keyof typeof versions]>({
test(loadPlugin, '19.x');
test(loadPlugin, '20.x');

/**
* The type of the `RulesConfig` have changed in [commitlint v20.3.1](
* https://github.com/conventional-changelog/commitlint/releases/tag/v20.3.1),
* and are no longer compatible with those from v19. Specifically the types of
* the `scope-case` and `scope-enum` rules have been changed to also accept a
* rule object. While the individual versions are able process this test without
* runtime or type errors, the combined signature causes type errors. To keep
* the test, a relatively long one, the same for both versions, the type of the
* rule config is cast.
*/
const lintUsingPluginRules = test.macro<[keyof typeof versions]>({
async exec(t, version) {
// eslint-disable-next-line @typescript-eslint/await-thenable
Expand All @@ -52,6 +62,7 @@ const lintUsingPluginRules = test.macro<[keyof typeof versions]>({
for await (const config of configs) {
const report = await versions[version].lint(
'chore: basic commit message',
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
{
[rule]: [
2,
Expand All @@ -60,7 +71,7 @@ const lintUsingPluginRules = test.macro<[keyof typeof versions]>({
? async () => config.ruleOutcome
: () => config.ruleOutcome,
],
},
} as unknown as any,
{plugins: {'function-rules': plugin}},
);

Expand Down