@@ -37,6 +37,16 @@ const loadPlugin = test.macro<[keyof typeof versions]>({
3737test ( loadPlugin , '19.x' ) ;
3838test ( loadPlugin , '20.x' ) ;
3939
40+ /**
41+ * The type of the `RulesConfig` have changed in [commitlint v20.3.1](
42+ * https://github.com/conventional-changelog/commitlint/releases/tag/v20.3.1),
43+ * and are no longer compatible with those from v19. Specifically the types of
44+ * the `scope-case` and `scope-enum` rules have been changed to also accept a
45+ * rule object. While the individual versions are able process this test without
46+ * runtime or type errors, the combined signature causes type errors. To keep
47+ * the test, a relatively long one, the same for both versions, the type of the
48+ * rule config is cast.
49+ */
4050const lintUsingPluginRules = test . macro < [ keyof typeof versions ] > ( {
4151 async exec ( t , version ) {
4252 // eslint-disable-next-line @typescript-eslint/await-thenable
@@ -52,6 +62,7 @@ const lintUsingPluginRules = test.macro<[keyof typeof versions]>({
5262 for await ( const config of configs ) {
5363 const report = await versions [ version ] . lint (
5464 'chore: basic commit message' ,
65+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
5566 {
5667 [ rule ] : [
5768 2 ,
@@ -60,7 +71,7 @@ const lintUsingPluginRules = test.macro<[keyof typeof versions]>({
6071 ? async ( ) => config . ruleOutcome
6172 : ( ) => config . ruleOutcome ,
6273 ] ,
63- } ,
74+ } as unknown as any ,
6475 { plugins : { 'function-rules' : plugin } } ,
6576 ) ;
6677
0 commit comments